Skip to main content
add tag
Link
mmmmmm
  • 31k
  • 18
  • 94
  • 158
Source Link

Display contents of file and also copy it to the clipboard

I would like to create a helper function that displays my public key in the terminal and also copies it to the clipboard. How would I do that?

I tried cat ~/.ssh/id_rsa.pub | pbcopy, but this only copies the key to the clipboard.