how to copy directory to a ssh server 1

how to copy directory to a ssh server

# Copy from machine a to b
scp -r /path/to/directory user@ipaddress:/path/to/destination

# Copy from machine b to a
scp -r user@ipaddress:/path/to/destination /path/to/directory

Here is what the above code is Doing:
1. The first line is the command to copy files from one machine to another.
2. The -r flag tells the command to copy recursively, meaning it will copy all files and subdirectories.
3. The first path is the path to the directory you want to copy.
4. The second path is the path to the destination directory.
5. The user@ipaddress is the username and IP address of the machine you want to copy to.

Similar Posts