I am a Linux user and wanted to just copy the output of commands such as pwd to the system clip board without hassles. Here is how:
1) Install xclip with apt-get
$ sudo apt-get install xclip
2) Pipe command output to xclip
$ <your command> | c=tr -d '\n' | xclip -selection clipboard
For example, this one-liner
$ pwd | c=tr -d '\n' | xclip -selection clipboard
copies the current directory path into the system-wide clipboard. Without the trailing option -selection clipboard, the content copied will not be available to other applications.
Command Alias
To make life even easier for lazy people like me, create the alias
alias "c=tr -d '\n' | xclip -selection clipboard"
in your ~/.bashrc, and use it this way:
$ pwd | c
Now you can paste the output of the command anywhere on your machine :)
Reference:
How can I copy the output of a command directly into my clipboard?
http://stackoverflow.com/a/5130969/1478110