Mac command line gold!

Mac command line gold!

Copy a file to the clipboard:

$ cat ~/.zshrc | pbcopy

The contents of my .zshrc are now on the clipboard and I can paste them into any other application (Mail.app, Word, whatever).

Paste the clipboard contents to the shell:

$ pbpaste > foo.txt

Anything that was on the clipboard is now in the file foo.txt.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s