The environment is Ubuntu 18.04 and zsh. Install xclip.
$ sudo apt install xclip
Then add the following to the end of .zshrc. If you are not using zsh, you should add it to .bashrc.
~/.zshrc
alias -g CC='| xclip -selection c'
Restart zsh and you're done. How to use
$ cat hoge.txt CC
You can now copy the contents of the file to the clipboard.
Recommended Posts