Skip to content

Instantly share code, notes, and snippets.

@joschuck
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save joschuck/aacd4e585a295868f3a5 to your computer and use it in GitHub Desktop.

Select an option

Save joschuck/aacd4e585a295868f3a5 to your computer and use it in GitHub Desktop.
Copy file contents to clipboard
# copy file content to clipboard
xsel --clipboard < new-clipboard-contents.txt
# copy clipboard to file
xsel --clipboard > current-clipboard-contents.txt
# To read a file into the X selection
xsel < file
# make use of the secondary selection
xsel --secondary < file
# swap the primary and secondary selections
xsel --exchange
# keep stuff
xsel --keep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment