I know that piping to pbcopy copies command line outputs to the clipboard.

How can I still show the output in the terminal ?


The tool of choice is called tee. Full description is available via man tee but you canprobably just use

echo test | tee >(pbcopy)

to get the result you are looking for.


You could just pbpaste immediately after.
echo test | pbcopy | pbpaste

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.