Copy To Clipboard In MacOS Terminal
PublishedFeb 24th, 2022
Copy the output of something to the clipboard with pbcopy using the “pipe” character |:
$ pwd | pbcopy
You now have the “working directory” of that terminal in the clipboard.
Go ahead.
Cmd + V that sucker into another window and you’ll see something like:
/Users/username
Guess which command will paste to the terminal???
You guessed it: pbpaste.
If you still have your working directory in the clipboard, when you run pbpaste you should see:
$ pbpaste /Users/username
Ain’t that fun?