Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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 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

1 Answer 1

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.