Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Simple Question that I just realized would be very useful.

Under Linux (or really any 'nix environment) is it possible from the command line (or by other fashions, but primarily command line) to copy a file to the clipboard? Any example of this working would be appreciated but the best answer would be a general case in which this is possible across multiple 'nix environments (I'm running Fedora 10 atm if that makes any difference).

share|improve this question

Looks like you want xclip.

share|improve this answer
+1: Awesome! I figured there was a program like that around, but didn't know the name :) – MikeyB Jun 25 '09 at 18:10

Are you in X? Or text-only?

If you're in text mode, it's dead simple if you're using screen (which is awesome):

<C-A>:readbuf /path/to/file

To paste:

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.