linux command to copy text to clipboard


Install xclip

sudo apt-get install xclip

Copy a string to clipboard

echo -n 'I will be copied to the clipboard!' | xclip -selection c

Use Control+Shift+V to paste the copied string to terminal!

Copy texts from a file to clipboard

xclip -in -selection c <filename>

Paste clipboard contents to a file

xclip -out -selection c <filename>

:)

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

About these ads

ReMo at Mozilla Reps, open-source enthusiast.

Tagged with:
Posted in Linux, Ubuntu
2 comments on “linux command to copy text to clipboard
  1. Dave says:

    Just an FYI your apt-get command is misspelled

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

To keep the Web Open
Web docs by developers, for developers on MDN Work <span>for</span> Mozilla
Firefox OS
Thanks for visiting my blog!
  • 480,213 hits from Aug, 2009
Follow

Get every new post delivered to your Inbox.