Topic Contributors
creator avatar  
mreschke
Matthew Reschke
Site Developer
Created: Oct 14th, 2008
Updated: Nov 27th, 2010
Topic Organization
LINUX (54)
File
Download Selected (zip)
Download Selected (tar.gz)
Edit
Select All
Select None
View
Detail
Detail Preview
Icons
Preview
Show Hidden
Hide Hidden
Full Manager
Reset Defaults
Open In New Tab
Open In New Window
List Archive Contents
Download File
Open
Download Folder (as .zip)
Xsel command line clipboard
Post # 114 permalink Topic #114 by mreschke on 2008-10-14 10:48:08 (viewed 3,029 times)

Program that copies command output to the clipboard

xsel is a linux GNU tool used to copy command line output or file output to your standard clip board for pasting.

http://linuxtidbits.wordpress.com/2008/02/22/command-line-to-clipboard/

To copy a text to the middle mouse button clipboard:

Code Snippet
xsel < /etc/fstab

To copy to the context-menu clipboard:

Code Snippet
xsel --clipboard < /etc/fstab

Also Xsel can be piped to:

Code Snippet
echo “a-bit-of-text” | xsel -c
cat /etc/make.conf | xsel -c

Paste

To output clipboard information to the terminal:

Code Snippet
xsel --clipboard

Its just as easy to output clipboard information to a file:
Code Snippet
xsel --clipboard > Baada-Boom.txt

To append the information:

Code Snippet
xsel --clipboard >> ~/.bashrc