Languages
[Edit]
EN

Linux - copy entire directory with scp

4 points
Created by:
marc_so
894

Hi, today I would like to show you how we can copy entire folder with all of it's files using SCP command under linux.

Below command copy entire directory from remote server to local machine:

scp -r root@2.2.2.2:/home/my_dir /home

It will copy entire my_dir from remote server and it will be copied to /home/my_dir on current computer.

-r flag means recursively - scp will copy all files below given directory recursively. 

From manual:

scp - secure copy (remote file copy program)

-r Recursively copy entire directories. 
Note that scp follows symbolic links encountered in the tree traversal.

 

See also:

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Linux

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join