In this article I'm going to share a simple bash function that makes dealing with system clipboard easier on linux:

clb () { TMP='/tmp/.clb.tmp' if [[ $1 = 'e' ]] then clb > $TMP $EDITOR $TMP cat $TMP | clb rm $TMP elif [[ -t 0 ]] then xsel -b -o else xsel -b -i fi }

You need to install xsel on your system.

Usage