How To Use Pbcopy And Pbpaste Commands On Linux - OSTechNix
Install Xclip / Xsel
Like I already said, Pbcopy and Pbpaste commands are not available in Linux. However, we can replicate the functionality of pbcopy and pbpaste commands using Xclip and/or Xsel commands via shell aliasing. Both Xclip and Xsel packages available in the default repositories of most Linux distributions. Please note that you need not to install both utilities. Just install any one of the above utilities.
To install them on Arch Linux and its derivatives, run:
$ sudo pacman xclip xsel
On Fedora:
$ sudo dnf xclip xsel
On Debian, Ubuntu, Linux Mint:
$ sudo apt install xclip xsel
Once installed, you need create aliases for pbcopy and pbpaste commands. To do so, edit your ~/.bashrc file:
$ vi ~/.bashrc
If you want to use Xclip, paste the following lines:
alias pbcopy='xclip -selection clipboard' alias pbpaste='xclip -selection clipboard -o'
Read full article from How To Use Pbcopy And Pbpaste Commands On Linux - OSTechNix
No comments:
Post a Comment