Download and Upload files to server through terminal

Download and Upload files to server through terminal

Instructor-svgAl-Mamun Sarkar
Mar 29 , 2021

We can download and upload files to the remote server through the terminal using scp command. 

Upload file to the server:

Syntex:

scp [source-file] [username]@[destination server]:/destination-path

Example:

scp project.zip root@example.com:/var/www/html

OR

scp project.zip root@123.142.123.43:/var/www/html

You can use either domain name or server IP address. Don't forget to replace filename (project.zip), username (root) and IP address(123.142.123.43)  

 

 Download file from the server:

Syntex:

scp [username]@[destination server]:/destination-path/filename [local-path]

Example:

scp root@example.com:/var/www/html/project.zip /var/www/html/

OR

scp root@123.142.123.43:/var/www/html/project.zip /var/www/html/

Same here you can use the domain name or server IP address. It's import if you don't replace filename (project.zip), the username (root), and IP address(123.142.123.43)  then you will not be able to download or upload

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram