1、將 文件/文件夾 從遠程 Ubuntu 機拷至本地(scp)
$scp -r username@192.168.0.1:/home/username/remotefile.txt
2、將 文件/文件夾 從本地拷至遠程 Ubuntu 機(scp)
$scp -r localfile.txt username@192.168.0.1:/home/username/
scp 命令可以用來通過安全、加密的連接在機器間傳輸文件。它與 rcp 相似。
- 把本地文件傳輸給遠程系統的一般語法是:
scp localfile username@tohostname:/newfilename
localfile 指定源文件,username@tohostname:/newfilename 指定目標文件。
- 要把本地文件 shadowman 傳送到你在 penguin.example.net 上的賬號內,在 shell 提示下鍵入(把 username 替換成你的用戶名):
scp shadowman username@penguin.example.net:/home/username
這會把本地文件 shadowman 傳輸給 penguin.example.net 上的 /home/username/shadowman 文件。
- 把遠程文件傳輸給本地系統的一般語法是:
scp username@tohostname:/remotefile /newlocalfile
remotefile 指定源文件,newlocalfile 指定目標文件。
- 源文件可以由多個文件組成。譬如,要把目錄 /downloads 的內容傳輸到遠程機器 penguin.example.net 上現存的 uploads 目錄,在 shell 提示下鍵入下列命令:
scp /downloads/* username@penguin.example.net:/uploads/
鏈接:https://blog.csdn.net/u013381011/article/details/78310903
鏈接:https://blog.csdn.net/u013381011/article/details/78310903