Mirror a directory with SCP

This article was published 6 years ago. Due to the rapidly evolving world of technology, some concepts may no longer be applicable.

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:

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.

Thoughts on this post

Leave a comment?

Leave a Reply