SCP zip file from linux to linux

1 points
Asked by:

How can I copy zip file from 1 linux server to another? I am on 1 remote server and want to copy zip file from remote server.

1 answer
3 points
Answered by:

SCP from linux to linux - command:

scp user_name@remote_ip_address:/remote_dir/ /local_dir/

Practical example (persoanlly use it a lot):

scp root@remote_ip_address:/opt/ .

This command will ask you for password to remote server.


/opt/ - it is your remote file

. - it will be copied to current directory where we are on current machine

We can also give destination directory like this:

scp user_name@remote_ip_address:/opt/ /home/

SCP copy directory

scp -r user_name@remote_ip_address:/opt/my_dir .


-r - Recursively copy entire directories, link to manual

It is good idea to zip entire directory before using scp, it'll save us time if the directory is large or contains a lot of small files.

0 comments Add comment
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.

❤️💻 🙂