2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-15 06:12:59 +00:00
cheat.sheets/sheets/xsel
2020-03-15 14:50:17 +00:00

21 lines
655 B
Plaintext

# xsel
# Command-line tool to access X clipboard and selection buffers
# Read from STDIN and save it to the clipboard; as if `Ctrl + C`.
echo 123 | xsel -ib
# A file's contents can also be provided to xsel(1x) via STDIN.
cat file | xsel -ib
# Send the clipboard's contents to STDOUT; as if `Ctrl + V`.
xsel -ob
# The contents of the clipboard can be saved to a file(s). Note that the use of
# `>` means that any existing file by the same name will be overwritten. Use
# `>>` to instead append the data to that file.
xsel -ob > file
# Clear the clipboard.
xsel -cb
# Send X11 primary selection to STDOUT, as if clicking mouse's middle button.
xsel -op