2017-06-10 20:23:09 +00:00
|
|
|
# xsel
|
2020-03-15 14:50:17 +00:00
|
|
|
# Command-line tool to access X clipboard and selection buffers
|
2017-06-10 20:23:09 +00:00
|
|
|
|
2020-03-15 14:50:17 +00:00
|
|
|
# Read from STDIN and save it to the clipboard; as if `Ctrl + C`.
|
2017-06-10 20:23:09 +00:00
|
|
|
echo 123 | xsel -ib
|
2020-03-15 14:50:17 +00:00
|
|
|
# A file's contents can also be provided to xsel(1x) via STDIN.
|
2017-06-10 20:23:09 +00:00
|
|
|
cat file | xsel -ib
|
|
|
|
|
2020-03-15 14:50:17 +00:00
|
|
|
# Send the clipboard's contents to STDOUT; as if `Ctrl + V`.
|
2017-06-10 20:23:09 +00:00
|
|
|
xsel -ob
|
2020-03-15 14:50:17 +00:00
|
|
|
# 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.
|
2017-06-10 20:23:09 +00:00
|
|
|
xsel -ob > file
|
|
|
|
|
2020-03-15 14:50:17 +00:00
|
|
|
# Clear the clipboard.
|
2017-06-10 20:23:09 +00:00
|
|
|
xsel -cb
|
|
|
|
|
2020-03-15 14:50:17 +00:00
|
|
|
# Send X11 primary selection to STDOUT, as if clicking mouse's middle button.
|
2017-06-10 20:23:09 +00:00
|
|
|
xsel -op
|