六月丁香五月婷婷,丁香五月婷婷网,欧美激情网站,日本护士xxxx,禁止18岁天天操夜夜操,18岁禁止1000免费,国产福利无码一区色费

學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > Linux scp遠(yuǎn)程復(fù)制命令大全詳解

Linux scp遠(yuǎn)程復(fù)制命令大全詳解

時(shí)間: 志藝942 分享

Linux scp遠(yuǎn)程復(fù)制命令大全詳解

  scp 命令是 SSH 中最方便有用的命令了,試想,在兩臺(tái)服務(wù)器之間直接傳送文件,僅僅用 scp 一個(gè)命令就完全解決了。那么你知道Linux scp遠(yuǎn)程復(fù)制命令大全詳解么?接下來是小編為大家收集的Linux scp遠(yuǎn)程復(fù)制命令大全詳解,歡迎大家閱讀:

  Linux scp遠(yuǎn)程復(fù)制命令大全詳解

  一般情況,本地網(wǎng)絡(luò)跟遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行數(shù)據(jù)交抱,或者數(shù)據(jù)遷移,常用的有三種方法,一是ftp,二是wget /fetch 三是,rsync 大型數(shù)據(jù)遷移用rysync,其次用fetch/wget ,最次是ftp,最慢是ftp.這幾天,在忙數(shù)據(jù)遷移時(shí),用到ssh的scp方法來遷移數(shù)據(jù)。速度與效果都很好。特別是現(xiàn)在許多服務(wù)器為了安全,都會(huì)改ssh默認(rèn)的22端口,改成一個(gè)特殊的端口。所以。在scp或者sftp時(shí),就要指定通過什么端口來遷移。現(xiàn)在,特記下這個(gè)特殊端口來scp的命令。

  scp -p port user@serverip:/home/user/filename /home/user/filename

  以上端口p 為參數(shù),port 端口 user 為ssh user serverip 為遠(yuǎn)程服務(wù)器ip或者域名 ,/home/user/filename 為遠(yuǎn)程服務(wù)器的文件名 /home/user/filename 為本地服務(wù)服務(wù)器的文件名。該命令的作用就是將遠(yuǎn)程的filename復(fù)制到本地對(duì)應(yīng)的目錄下面。

  scp 的作用真的很巨大,詳細(xì)用法,可以man scp 或者 scp –help ,下面為附上一篇 scp 使用詳解。。。

  linux 的 scp 命令 可以 在 linux 之間復(fù)制 文件 和 目錄;

  ==================

  scp 命令

  ==================

  scp 可以在 2個(gè) linux 主機(jī)間復(fù)制文件;

  命令基本格式:

  scp [可選參數(shù)] file_source file_target

  ======

  從 本地 復(fù)制到 遠(yuǎn)程

  ======

  * 復(fù)制文件:

  * 命令格式:

  scp local_file remote_username@remote_ip:remote_folder

  或者

  scp local_file remote_username@remote_ip:remote_file

  或者

  scp local_file remote_ip:remote_folder

  或者

  scp local_file remote_ip:remote_file

  第1,2個(gè)指定了用戶名,命令執(zhí)行后需要再輸入密碼,第1個(gè)僅指定了遠(yuǎn)程的目錄,文件名字不變,第2個(gè)指定了文件名;

  第3,4個(gè)沒有指定用戶名,命令執(zhí)行后需要輸入用戶名和密碼,第3個(gè)僅指定了遠(yuǎn)程的目錄,文件名字不變,第4個(gè)指定了文件名;

  * 例程:

  scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music

  scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music/002.mp3

  scp /home/space/music/1.mp3 www.cumt.edu.cn:/home/root/others/music

  scp /home/space/music/1.mp3 www.cumt.edu.cn:/home/root/others/music/002.mp3

  * 復(fù)制目錄:

  * 命令格式:

  scp -r local_folder remote_username@remote_ip:remote_folder

  或者

  scp -r local_folder remote_ip:remote_folder

  第1個(gè)指定了用戶名,命令執(zhí)行后需要再輸入密碼;

  第2個(gè)沒有指定用戶名,命令執(zhí)行后需要輸入用戶名和密碼;

  * 例程:

  scp -r /home/space/music/ root@www.cumt.edu.cn:/home/root/others/

  scp -r /home/space/music/ www.cumt.edu.cn:/home/root/others/

  上面 命令 將 本地 music 目錄 復(fù)制 到 遠(yuǎn)程 others 目錄下,即復(fù)制后有 遠(yuǎn)程 有 ../others/music/ 目錄

  ======

  從 遠(yuǎn)程 復(fù)制到 本地

  ======

  從 遠(yuǎn)程 復(fù)制到 本地,只要將 從 本地 復(fù)制到 遠(yuǎn)程 的命令 的 后2個(gè)參數(shù) 調(diào)換順序 即可;

  例如:

  scp root@www.cumt.edu.cn:/home/root/others/music /home/space/music/i.mp3

  scp -r www.cumt.edu.cn:/home/root/others/ /home/space/music/

  
看了“Linux scp遠(yuǎn)程復(fù)制命令大全詳解”還想看:

1.linux scp怎么遠(yuǎn)程拷貝文件

2.linux下scp遠(yuǎn)程拷貝怎么使用

3.怎么利用scp命令來實(shí)現(xiàn)linux系統(tǒng)之間互傳文件

4.LINUX操作系統(tǒng)SCP的命令使用方法

5.Linux scp命令怎么使用

2917352