I’ve been known to cat README.md | pbcopy a file. There’s a better way: the input redirection operator!
My command says this: “Concatenate the README, then send the output of that to the pbcopy program.” In the end, the README contents are in my paste buffer.
Here’s the better command:
pbcopy < README.md
This uses the input redirection operator, <, to send the README contents into pbcopy. No concatenation, no pipe, just markdown straight to the program.
Some might call my first example a Useless Use of Cat, because we aren’t concatenating anything, and if so, I’ll try to do better.
See man zshmisc on Mac for more.