scp username@servername:/path/filename /local/path
例如: scp ubuntu@117.50.20.56:/ygf/data/data.txt /desktop/ygf 把117.50.20.56上的/ygf/data/data.txt 的文件下載到/desktop/ygf目錄中ubuntu
scp /local/path/local_filename username@servername:/path
例如: scp /ygf/learning/deeplearning.doc ubuntu@117.50.20.56:/ygf/learning 把本機/ygf/learning/目錄下的deeplearning.doc文件上傳到117.50.20.56這臺服務器上的/ygf/learning目錄中服務器
scp -r username@servername:/path /path
例如: scp -r ubuntu@117.50.20.56:/home/ygf/data /local/local_dir 「-r」命令是文件夾目錄,把當前/home/ygf/data目錄下全部文件下載到本地/local/local_dir目錄中
spa
scp -r /path username@servername:/path
例如: scp -r /ygf/test ubuntu@117.50.20.56:/ygf/tx 「-r」命令是文件夾目錄,把當前/ygf/test目錄下全部文件上傳到服務器的/ygf/tx/目錄中server