What we'd like to do is have a quick way of sending text to the clipboard from terminal in linux. We can accomplish this with pipes and xclip. We'll install and configure xclip and then review the proper usage.
First we install xclip:
Next we want to configure an alias for xclip so that the arguments "-selection c" are used every time we call xclip. This ensures that the text is piped (copied) into the correct clipboard. This command will place the alias specification into the .bashrc file in our home directory.
Now we need to load our new .bashrc settings into the current window or open a new window.
Now we can use xclip as follows:
In my case I like being able to copy my public keys directly from file into github, so I use it like so: