Was watching a CD video with Semaphore and saw the guy in the video manipulating clipboard with pipe directly in the terminal. Pretty cool! Did some research on that.
cat my.key.pub | pbcopy
pbpaste > my.otherKey.pub
ps aux | grep myKeyWord | pbcopy
pbcopy < file.txt
pbpaste | grep myKeyWord
Take Ubuntu as example here. We can install a 16 kB program called
sudo apt-get install -y xclip
Then we can set alias so we can do the above operation like in osx. If you use
bash then set your
alias pbcopy='xclip -selection clipboard' alias pbpaste='xclip -selection clipboard -o'
If you are like me using
fish as main shell, then similarly add below to your
alias pbcopy "xclip -selection clipboard" alias pbpaste "xclip -selection clipboard -o"