Every Google search for copying a Mac's SSH Public Key to clipboard yields the following command, which results in a newline appended:
pbcopy < ~/.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-
Best Answer
To copy your SSH Public Key cleanly to clipboard WITHOUT a trailing newline use
or (without
cat
)