為什么用?
我們有時候會經常需要在各個操作系統間傳輸文件,如果服務器沒有安裝FTP服務,或者不知道FTP賬戶密碼,又或者覺得FTP操作不是很方便,想實現一鍵傳輸。
PSCP作為一款輕量級的軟件,使用簡單,安全可靠,且可定制腳本,是比較好的文件傳輸工具。
怎么用?
- 下載地址:
64位 https://the.earth.li/~sgtatham/putty/latest/w64/pscp.exe
32位 https://the.earth.li/~sgtatham/putty/latest/w32/pscp.exe
- 把pscp.exe放到C:\Windows\System32 文件夾下(在任意地方打開cmd.exe都能執行pscp命令)
- linux --> windows (linux下 /tmp/test.log 傳到 windows D:\test\文件夾下)
pscp -pw linuxroot密碼 root@192.168.0.1:/tmp/test.log D:\test\
- windows --> linux (windows D:\test\test.log 傳到 linux下 /tmp/文件夾下)
pscp -pw linuxroot密碼 D:\test\test.log root@192.168.0.1: /tmp/
- 定制腳本(每天都需要查看linux服務器上日志):
- 新建log.bat
- 內容為:
pscp -pw linuxroot密碼 root@192.168.0.1:/tmp/test.log D:\test\