Pipe to/from the clipboard in a Bash script
2018 answer Use clipboard-cli. It works with macOS, Windows, Linux, OpenBSD, FreeBSD, and Android without any real issues. Install it with: Then you can do: If you want, you can alias to cb by putting the following in your .bashrc, .bash_profile, or .zshrc: