scp命令用于通過ssh在兩臺服務器之間傳輸文件。大多數scp用戶在系統中已經可以使用scp命令,但它仍然顯示“bash:scp:command not found”。因此注意,scp命令必須在本地和遠程系統上都可用才可以避免這個問題。
安裝SCP命令包
scp命令來自Red Hat系統上的openssh-clients軟件包,openssh-client軟件包用于基于debian的系統。可以使用以下命令在linux操作系統上安裝scp命令包。
centos / RHEL和Fedora
#yum?install?openssh-clients
Ubuntu和Debian
$?sudo?apt-get?install?openssh-client
使用SCP命令傳輸文件
本地到遠程:要將文件/opt/myfile.txt從本地傳輸到遠程(remote.example.com)系統的/opt/Directory,可以使用以下命令。
#?scp?/opt/myfile.txt?remote.example.com:/opt/
遠程到本地:要將文件/opt/myfile.txt從遠程(remote.example.com)系統傳輸到本地系統/ opt目錄,使用以下命令。
#scp?remote.example.com:/opt/myfile.txt?/?opt?/
本篇文章到這里就已經全部結束了,更多其他精彩內容可以關注php中文網的其他相關欄目教程!!!
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END