SCP a Directory in OSX

When copying a directory with scp on macOS, the placement of the trailing slash matters.

If you want to copy the folder source and keep the folder itself in the destination path, use:

scp -r /path/to/source user@host:/path/for/dest/

That will copy the source directory into /path/for/dest/.

For example, if you run:

scp -r /Users/martyn/source user@example.com:/tmp/

the result on the remote host will be:

/tmp/source