Did this blog help you solve a problem? Tip me with Bitcoins at: 17dQktcAmU4urXz7tGk2sbuiCqykm3WLs6

Monday, August 1, 2011

Pull Entire Directory Using SCP on a Mac

The following command can be used to fetch an entire directory including all the files from a remote host to a local directory.

$ scp -r username@host:/fully/qualified/path/on/remote/host/ /fully/qualified/path/on/local/host/

An alternative approach is to reference a directory relative to the user's account.

$ scp -r username@host:user's/path/on/remote/host/ user's/path/on/local/host/

Or using '.', the files will be copied to the current working direcory

$ scp -r username@host:user's/path/on/remote/host/ .

To use a wildcard to fetch only certain file types use the * syntax.

$ scp -r username@host:user's/path/on/remote/host/*.png .

Piece of Cake!!!

No comments: