Yos Riady optimize for learning

Handy bash command to copy to clipboard

I learned a nifty bash trick today. Check out the following code:

cat ~/.ssh/id_rsa.pub | pbcopy

The above copies your ssh public key into your clipboard.

Basically, we can pipe the output of any bash command to pbcopy, and have its contents of the previous operations copied directly to our clipboard. To paste the contents of your clipboard:

$ pbpaste

Handy!

Author

You should follow him on Twitter.

📬 Get updates straight to your inbox!

Subscribe to my newsletter to make sure you don't miss anything.




Here's something you might be interested in...

Going Serverless book

Have you heard about the Serverless programming model? The Going Serverless book teaches you how to build scalable applications with the Serverless framework and AWS Lambda. You'll learn how to design, develop, test, deploy, and secure Serverless applications from planning to production.

Learn more →