Linux equivalent of clip.exe
Solution 1:
Practically everything in Linux comes in the form of "additional packages" – usually shared libraries which are written once and used in hundreds of programs to avoid needless duplication. You shouldn't be afraid of them unless you are critically low on disk space.
However, Linux itself does not have a "clipboard"; this function is part of the X11 graphical interface. Both xsel
and xclip
require X11 to work – it does not have to be on the server (which only needs libX11 and xauth, nothing more); if you are connecting over SSH, X11 can be running on your desktop; but you still need the X11 display somewhere.
local$ ls | xsel -i
local$ ssh -Y myserver
myserver$ xsel -o > list.txt
(In this example, ssh -Y
enables X11-over-SSH, allowing you to run X11 programs on the server and have them connect to the local X11 display. The differences between xsel
and xclip
are very minimal, their core functionality is same.)
If you are working at the console, in a text-only tty, these tools won't work. You will have to use something like gpm
or screen
or tmux
instead – gpm
works by adding mouse support to the tty's, while screen
and tmux
both are "terminal multiplexers" which only have the clipboard as a secondary feature (but are nevertheless useful, allowing tiling of multiple terminals in one tty).