Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I copy text to the clipboard from one file by shell? and I want to paste it to Browser later.

share|improve this question

migrated from serverfault.com Feb 5 '12 at 16:35

This question came from our site for system and network administrators.

search for xclip – Zoredache Feb 2 '12 at 6:01

You want xclip.

$ xclip -i -selection clipboard <<< "*foo bar*"

foo bar

share|improve this answer
the -i switch is optional i seem to remember – ixtmixilix Feb 8 '12 at 0:11
@ixtmixilix: Sure. But it doesn't hurt to be explicit. – Ignacio Vazquez-Abrams Feb 8 '12 at 1:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.