Xclip

16 Nov 2020

Overlooked Tools: xclip

If you have ever had a need to move the output of a Linux console command to your clipboard, xclip is the solution!

To copy a file’s contents to the standard “ctl+c/v” clipboard buffer issue you can following this command:

1
xclip -sel clip your-file-path

The most useful feature is reading from a stdin pipe:

1
head my-file-path | xclip -sel clip

…and then your ready to paste into an email or Slack chat.