Retrieve and set the X selection
Manual pages:
user@host:~$
To install xsel on Debian:
root@host:~$ apt-get install xsel
A simple example:
root@host:~$ ls /tmp/ | xsel --clipboard --input root@host:~$ xsel --clipboard --output | cat
To check the status of :
root@host:~$