[LINUX] scp command

  
        

[LINUX] scp command, copy this machine to a remote machine

Copy folder (including the folder itself)

scp -r /home/wwwroot/www/charts/util [email protected]:/home/wwwroot/limesurvey_back/scp

Copy all files under the folder (excluding the folder itself)

scp /home/wwwroot/www/charts/Util/* [email protected]:/home/wwwroot/limesurvey_back/scp

Copy and rename files

scp /home/wwwroot/www/charts/util/a.txt root @192.168.1.65:/home/wwwroot/limesurvey_back/scp/b.text
Copy remote files to this machine

#scp [email protected]:/usr/local/sin.sh /home/Administrator

remote Log in to the remote server through the remote user (other users with the same privileges can also be used)

www.abc.com The domain name of the remote server (of course, you can also use the server IP address) )

/usr/local/sin.sh File to be copied to the local machine on the remote server

/home/administrator Copy the remote file to the local absolute path

Two points:

1. If the remote server firewall has special restrictions, scp will have to take a special port, depending on the port, the command format is as follows:

#scp -p 4588 [email protected]:/usr/local/sin.sh /home/administrator

2. Use scp to pay attention to whether the user you use has the right to read the corresponding files of the remote server.

Copyright © Windows knowledge All Rights Reserved