linux scp命令是很多編程的小伙伴會(huì)用到的,小伙伴們需要掌握l(shuí)inux scp命令的語(yǔ)法等進(jìn)行使用,那linux scp命令怎么用,西西小編來(lái)為大家介紹。
linux scp命令怎么用
Linux scp命令
scp是 secure copy的縮寫(xiě), scp是linux系統(tǒng)下基于ssh登陸進(jìn)行安全的遠(yuǎn)程文件拷貝命令,是 cp 命令的加強(qiáng)版。
語(yǔ)法
scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file][-l limit] [-o ssh_option] [-P port] [-S program][[user@]host1:]file1 [...] [[user@]host2:]file2
簡(jiǎn)易寫(xiě)法
scp [可選參數(shù)] file_source file_target
常用的可選參數(shù)
-P 大寫(xiě)的,指定端口號(hào)
-r 遞歸復(fù)制整個(gè)目錄
-v 顯示所有 debug 信息
-q 不顯示傳輸進(jìn)度
-C 大寫(xiě)的,啟用壓縮
-4 使用 IPv4 地址
-6 使用 IPv6 地址
本地復(fù)制到遠(yuǎn)程
scp -r local_folder remote_username@remote_ip:remote_folder
或者
scp -r local_folder remote_ip:remote_folder
第1個(gè)指定了用戶(hù)名,命令執(zhí)行后需要再輸入密碼;
第2個(gè)沒(méi)有指定用戶(hù)名,命令執(zhí)行后需要輸入用戶(hù)名和密碼;
以上就是西西小編為大家?guī)?lái)的linux scp命令怎么用,希望大家喜歡。