Copying & Pasting In CLI With pbcopy & pbpaste
The pbcopy and pbpaste are very handy commands to copy from the clipboard buffer or paste into standard out. Having a good control of these commands can make your workflow even more efficient.
Using the pipe command (need a refresher on the pipe command?) you can copy output directly from a source right into your clipboard:
If you use something like jq (we wrote about it here) you can take some JSON and format it all in one command:
The above command take any JSON in your clipboard, put it into a pretty format and copy it back to your clipboard, so it will make this:
Look like this:
Read more about it here