Redirect terminal output to clipboard.
Less than 1 minute
Redirect terminal output to clipboard.
This post is about using xclip
command to redirect the output of a command to clipboard.
- install
xclip
- use command
cat output | xclip -selection clipboard
to redirect the flow - (Optional) Set an alias.
e.g.alias clip=”xclip -selection clipboard”
- Remember that the alias needs to be added to
~/.bashrc
to take effect permanently.