linux copy files or folders from one server to another

Copy file or directory command:
  Copy file:
  (1) Copy the local file to the remote
  scp file name username@computer IP or computer name: remote path

  
  local 192.168.1.8 client
  scp  /root/install.* [email protected]:/usr/local/src


  (2) Copy the file from the remote back to the local
  scp username@computer IP or computer name:filenamelocal path

 

  The local 192.168.1.8 client fetches the files on the remote servers 12 and 11
  scp  [email protected]:/usr/local/src/*.log  /root/
  scp  [email protected]:/usr/local/src/* .log  /root/


  Copy directory:
  (1) Copy the local directory to the remote
  scp -r directory name username@computer IP or computer name: remote path
  (2) copy the directory back from the remote to the local
  scp -r username@computer IP or computer name: directory name local path


Original link http://zhangxing119.iteye.com/blog/2149274

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325980255&siteId=291194637