My friend Josh recently wrote about a common mistake using pbcopy, Apple’s pasteboard utility. To paraphrase, the “bad” command creates a new file called pbcopy:

cat <file> > pbcopy

While the “good” command does what we expect, send the file to your clipboard:

cat <file> | pbcopy

There’s a third approach that avoids cat entirely, and may make this mistake completely avoidable for some:

pbcopy < <file>