用PuTTY鏈接Linux上傳下載文件經常使用方法

用pscp上傳文件到Linux: linux

 

[plain]  view plain copy
  1. pscp -pw password -P port d:\putty\sourcefile.txt root@remote_host :/dest_dir/  

 

用psftp鏈接Linux,從linux上下載文件:session

 

[plain]  view plain copy
  1. psftp -l root -pw password -P port remote_host  

 

查看幫助:ui

 

[plain]  view plain copy
  1. psftp> help  
  2. !      run a local command  
  3. bye    finish your SFTP session  
  4. cd     change your remote working directory  
  5. chmod  change file permissions and modes  
  6. close  finish your SFTP session but do not quit PSFTP  
  7. del    delete files on the remote server  
  8. dir    list remote files  
  9. exit   finish your SFTP session  
  10. get    download a file from the server to your local machine  
  11. help   give help  
  12. lcd    change local working directory  
  13. lpwd   print local working directory  
  14. ls     list remote files  
  15. mget   download multiple files at once  
  16. mkdir  create directories on the remote server  
  17. mput   upload multiple files at once  
  18. mv     move or rename file(s) on the remote server  
  19. open   connect to a host  
  20. put    upload a file from your local machine to the server  
  21. pwd    print your remote working directory  
  22. quit   finish your SFTP session  
  23. reget  continue downloading files  
  24. ren    move or rename file(s) on the remote server  
  25. reput  continue uploading files  
  26. rm     delete files on the remote server  
  27. rmdir  remove directories on the remote server  

對本地文件的命令都是以「l」開頭的。

 

 

將遠程當前工做目錄文件sourcefile.txt下載到 本地當前工做目錄中:
[plain]  view plain copy
  1. psftp> get sourcefile.txt  

將本地當前工做目錄文件sourcefile.txt上傳到 遠程當前工做目錄中:
[plain]  view plain copy
  1. psftp> put  source.txt  

查看端口使用狀況:

 

[plain]  view plain copy
  1. netstat -tanp