Xclip
From Grayhat cheatsheets
Jump to navigationJump to searchxclip is an application that manages the clipboard, and needs to be installed.
To save something on the clipboard:
echo asdf | xclip -i
To extract it:
xclip -o
There are 3 buffers, primary (saves highlighted text), clipboard (copied text) and secondary (auxiliar). We can extract from each of them with the selector "p", "c" or "s":
xclip -o -selection p (o s o c)