Copy SSH Public Key to clipboard WITHOUT newline appended Every Google search for copying a Mac's SSH Public Key to clipboard yields the following command, which results in a newline appended:

pbcopy &lt; ~/.ssh/id_rsa.pub


This is undesirable as I need to paste a Public Key into a variable in an application I'm developing.  In the hopes of saving folks the trouble of solving the same problem, I'll post my solution to this question in the answers section-
To copy your SSH Public Key cleanly to clipboard WITHOUT a trailing newline use

cat ~/.ssh/id_rsa.pub | tr -d '\n' | pbcopy


or (without cat)

tr -d '\n' &lt; ~/.ssh/id_rsa.pub | pbcopy