I want to pipe/dump the contents (esp. text) of the clipboard/Ctrl+C to a file, preferably using Bash or Perl (in order). I'd rather not use GUI applications please.
How to pipe clipboard contents to a file?
You can do it using
xsel. Type in terminal to install it,
sudo apt-get install xsel
To put the contents of a file to the clipboard use:
xsel -b < some.txt
To paste the contents of the
clipboard to a file use.
`xsel -b >> some.txt`