How To Download and Upload Directories Recursively In Linux
  • Post category:Programming
  • Post comments:0 Comments
  • Post author:
  • Post published:14/04/2021
  • Post last modified:14/04/2021

scp is popular protocol and command used to download and upload files and directories in a secure manner. We have all ready examined most of the scp command features in the following tutorial. In this tutorial we will learn hoe to copy directories or folders recursively with scp .

Linux Scp Command Usage With Eamples

Recursive Option

-r option is used to download or upload files recursively. The copy direction is not important. So for all copy directions recursivity is enabled. It is expressed like below.

$ scp -r

Download Directories Recursively

We will start download directories or folders recursively from remote system to the local system. In this example we will download directories from IP address

$ scp -r /home/ismail/other
Download Directories Recursively
Download Directories Recursively

Upload Directories Recursively

In this example we will upload given directory content to the remote system recursively.

$ scp -r Desktop/
Upload Directories Recursively
Upload Directories Recursively

Preserve Modification, Access Times and Modes

While uploading and downloading files and directories recursively we may need to preserve the file and directories modification and access times with modes. So we can use -p option to preserve given attributes.

$ scp -r -p Desktop/

Use Compression

Recursive operations generally transmits a lot of data. We can use the -C option in order to compress transmitted data. This will made our transfer faster while using less bandwidth.

$ scp -r -C Desktop/
Use Compression
Use Compression

LEARN MORE  What Is FTP (File Transfer Protocol)?

Leave a Reply