Linux與windows之間檔案傳輸__Linux

來源:互聯網
上載者:User

Linux系統之間傳輸檔案有很多種方法,此篇部落格介紹其中的兩種。也是在開發過程中經常用到的。

一般情況下,個人經常用到rz或sz命令來上傳下載檔案。 rz sz 上傳下載

安裝rz,sz,操作很簡單。

yum install lrzsz

安裝之後,就可以進行基本的上傳下載操作:

通過SecureCRT執行rz,進行上傳操作。

[root@iZ25ltqcjzrZ ~]# rz

會快顯視窗,選擇上傳檔案,等待完成。當然rz還有一些參數,比如一般使用:

rz -bey
scp傳輸檔案

由於部分伺服器安全考慮,不讓安裝rz軟體,只好使用scp傳輸。scp的操作命令其實很簡單。

將本地檔案傳輸的到目標伺服器的指定路徑下:

# 檔案複製$scp local_file remote_username@remote_ip:remote_folder# 目錄複寫$scp -r local_folder remote_username@remote_ip:remote_folder

其中local_file為本地檔案,remote_username目標伺服器登入名稱稱,remote_ip目標伺服器密碼,remote_folder目標伺服器下的目標路徑。

將遠程檔案cp到本地:

$scp remote_username@remote_ip:remote_file local_folder

對比一下從本地cp到遠程伺服器,只是把目標和源對調了一下。 SFTP

SecureCRT可以通過快速鍵Alt+p進入sftp串連模式。

下載檔案

sftp>get 檔案絕對路徑

查看下載到本地的路徑,得到下載到本地的路徑

sftp>lpwd

上傳檔案:

sftp>put 本地檔案絕對路徑

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.