Use of the (Desktop) Clipboard in the Command Line
clipcopy and clippaste
- When using a oh-my-zsh, the commands
clipcopyandclippastecan be used to access the clipboard. These commands are platform-agnostic
xclip
-o: paste tostdout- Use
-sel clipoption to use the main clipboard. Defaults to middle-mouse-click temporary clipboard otherwise. - Very useful when combined with pipes e.g.
echo "test" | xclip -sel clip
clip.exe for WSL
- Copy into the Windows clipboard from WSL can be done by piping into
clip.exe