Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to use xclip

📅 2016-Mar-09 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ clipboard, copy, paste, shell, vim, xclip ⬩ 📚 Archive

xclip is a very useful tool to copy and paste text content between the shell and GUI (X11) programs. You can pipe text to xclip and that text will be copied to the X clipboard. You can invoke xclip to output and it will spit out the content in the X clipboard. Once you learn it, you will wonder how you ever worked without it at the shell, inside Vim and across SSH sessions.

$ sudo apt install xclip
$ pwd | xclip
$ xclip -o | ls

Tried with: XClip 0.12 and Ubuntu 14.04


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧