xsel is a program that allows X selection manipulation, and it can also be used to manipulate clipboard contents.
Open a terminal window and run the command bellow. The
-b options tells
xsel to operate on the CLIPBOARD selection and the
-o is used to write the selection contents to standard output.
xsel -b -o
xsel reads from the standard input into the selection, so for instance, the output of the
echo command can be piped into
xsel thus set the clipboard contents. Replace CB_DATA with is a string for clipboard data.
echo CB_DATA | xsel -b -i
echo "Xubuntu Geek" | xsel -b -i