Mirror a directory with SCP

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.

Michael is a polyglot software engineer, committed to reducing complexity in systems and making them more predictable. Working with a variety of languages and tools, he shares his technical expertise to audiences all around the world at user groups and conferences. You can follow @mheap on Twitter

Thoughts on this post

Leave a comment?

Leave a Reply