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 (, 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: Logo

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

Facebook photo

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

Connecting to %s