Easy copy to clipboard on Linux

Copy the contents of the file to the clipboard

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.


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

Easy copy to clipboard on Linux
Easy way to load CPU / memory on Linux
Easy df command on Linux
How to install VMware-Tools on Linux
How to install aws-session-manager-plugin on Manajro Linux
I want to use Linux on mac
How to update php on Amazon linux 2
How to display emoji on Manjaro Linux
Upgraded mysql on Cloud9 (Amazon Linux) (5.5 to 5,7)
How to install packages on Alpine Linux
5 reasons to install Linux on your laptop.
How to install Anisble on Amazon Linux 2
How to update security on CentOS Linux 8
How to install php7.4 on Linux (Ubuntu)
On Ubuntu Linux, set Tab to q
How to find large files on Linux
Gusto cannot connect to Wifi on Linux
[Linux] Introduction to Linux
Easy script migration from CentOS to Oracle Linux
Easy way to use Python 2.7 on Cent OS 6
Deliver OBS footage to Zoom on Arch Linux
Try to create a new command on linux
How to install Camunda Modeler on Manjaro Linux
I want to log file I / O on Linux
How to build Java environment on Ubuntu (Linux)
Daemonizing processes on Linux
jblas on Arch Linux
How to use C216 Audio Controller on Arch Linux
Linux (WSL) on Windows
NAT router on Linux
Introduce serverspec to Linux
Easy to use Flask
Very easy to install SciPy on Mac OS X
Yum command to access MySQL with Python 3 on Linux
How to install Linux on a 32bit UEFI PC
Linux commands to remember
How to allow nologin users to log in on Linux
How to run Self bot on Discord.py [Easy vandalism! ]
Copy files directly from Amazon EC2 (Amazon linux) to S3
Develop .NET on Linux
Wake on lan on Linux
Preparing to use Ansible on an existing Linux server
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
Monitor traffic on Linux
Easy to use SQLite3
Update vscode on linux
[AWS EC2] How to install Maven on Amazon Linux 2
Try NeosVR on Linux
How to install git on Linux such as EC2
Check capacity on Linux
[Tips] How to use iPhone as webcam on Linux
How to build a Python environment on amazon linux 2
LiveUSB creation on Linux
[AWS] How to expand disk space on Amazon linux
Linux operation on Win10
A memo on how to easily prepare a Linux exercise environment
[Linux] Copy data from Linux to Windows with a shell script
How to share OS and Vim clipboard on Ubuntu 18.04.3 LTS
[For beginners] How to use for statements on Linux (variables, etc.)
[AWS EC2] Settings you want to do on Amazon Linux 2
Game distribution to YouTube Live on Arch Linux (Nintendo Switch)