How to Copy To Clipboard in Terminal

Hi there 👋🏾. I'm a software engineer that enjoys building stuff and talking about them. I also tinker a bit with hardware and robotics using Arduino and ROS.
Use the x-clip package to copy the content of a file to your clipboard from your the terminal. We'll go over the steps to achieve this.
Steps
- Create a file lorem.txt and populate it with lorem-ipsum
cat > lorem.txt << EOF Lorem ipsum dolor sit amet consectetur adipisicing elit. Incidunt debitis magnam provident nam cum alias nisi suscipit perspiciatis veritatis? Assumenda. EOF - Install xclip
sudo apt install xclip - Select the file using
xclip -sel c < filenamexclip -sel c < lorem.txt-selrefers to selection andcrefers to clipboard. You can runxclip -hfor more info. - Check the content of your clipboard
Lorem ipsum dolor sit amet consectetur adipisicing elit. Incidunt debitis magnam provident nam cum alias nisi suscipit perspiciatis veritatis? Assumenda.
For more tutorials and tips like this, subscribe to my newsletter. Thanks for reading. Adios.
