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 user@192.xxx.xxx.xxx:/usr/data/myRemoteDir/ /path/local/dir
Password: 

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.



Top Hashtags:

Advertisements

Advertisements




Advertisements