Mirror a directory with SCP

20 May 2013 in Unix Toolbox

Another short one today, courtesy of Chris H.

When working in a directory, if you need to copy everything from the current directory to
an identical path on another machine, you can do it as follows:

bash
scp -r ./* remote.host:$PWD

This is also possible with rsync, but as the SCP syntax is much simpler it's a nice one liner to know.