SSH method for uploading files and folders to linux server

  • 2020-12-07 04:36:59
  • OfStack

Now there are many servers linux. Can't you send a file? Here's how:

1. Upload files to linux server

First switch from your local to the directory where you want to upload the file. Next:

scp file Name Server user name @server ip: directory

Example:


 scp index.html root@58.87.124.110:/home/service-tomcat/webapps/

2. Upload folders to linux server

With file uploads, you just prefix the file name with -r

Example:


 scp static/ root@58.87.124.110:/home/service-tomcat/webapps/

Note:

1. Add -ES27en before the file to be uploaded; otherwise, error will be reported


static: not a regular file
-r: No such file or directory

2, to upload the file after the best /

conclusion


Related articles: