SCP on a Mac

$cp: foo@bar.com/path/: No such file or directory

This is a weird error to get. I had never used “scp” on my Mac before, only ssh, but I was familiar with sending commands over ssh to remote boxes like this:

$git clone ssh://foo@bar.com/~/www/ .

This command would clone the remote repository into the current directory. I (wrongly) assumed that sytax for other commands was the same as git.

Just in case anyone else out there is having trouble with the syntax for the command “scp” on a mac here is the correct usage:

$scp foo@bar.com:~/www/* .

This would clone all the files in the ~/www/ directory into the current directory on your Mac. If you want all the subdirectories add the “-r” flag like you would locally.

comments powered by Disqus