How to use pbcopy on Ubuntu
this command line enables you to copy the standard input from terminal window to your clipboard enabling you to paste it to other applications.
pbcopy
on a mac enables you to copy the standard input from terminal window to your clipboard enabling you to paste it to other applications.
You can replicate pbcopy
on ubuntu by utilising a similar tool called xclip
which does exactly the same. However its syntax is a little too verbose and I prefer to use OS X pbcopy
command.
how to configure pbcopy on ubuntu
If you haven’t previously installed xclip simply run the following command in your terminal window:
sudo apt-get install xclip -y
Edit your BASH settings file using your favorite text editor.
nano ~/.bashrc
Then create an alias for pbcopy and pbpaste:
alias pbcopy=’xclip -selection clipboard’
alias pbpaste=’xclip -selection clipboard -o’
Close and save the file then just refresh your bash to import your new settings
source ~/.bashrc
Usage
pbcopy < /etc/resolv.conf