Bash – Print the system clipboard content in bash

bashclipboardxorg

There is a way to put some command output to system clipboard via xclip.

some-command | xclip -selection clipboard

I'd like to perform a reverse task – Print system clipboard to terminal. How it can be done?

Best Answer

According to the manpage the -o option to xclip shoves data in the opposite direction:

   -i, -in
          read text into X selection from standard input or files (default)

   -o, -out
          prints the selection to standard out (generally for piping to a file or program)

In your above command, the -i is being assumed.

Related Question