SCP Copy all files from directory to Local Folder

In this article, we will take a look at how to copy all files from the directory to a local folder,

Remote Folder Directory:
# ls -ltrh
total 8.0K
-rw-r--r-- 1 root root 100 Apr  1 12:34 data.txt
-rw-r--r-- 1 root root   9 Apr  8 12:28 2022-02-04-server.log
-rw-r--r-- 1 root root   0 Apr  8 12:29 localhost.log
-rw-r--r-- 1 root root   0 Apr  8 12:29 image.png
SCP Command:
# scp -r /path/local/dir

data.txt      100%   100     1.8KB/s   00:00    
2022-02-04-server.logs  100%   8     0.12KB/s   00:01    
localhost.log       100%   8     0.1KB/s   00:00    
image.png          100%  8     0.22KB/s   00:00    

✌️Use -r to copy all the files within a directory with scp command.

Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.