linux高階拷貝指令scp怎麼使用
linux指令scp
scp — secure copy (remote file copy program):她是一個安全的遠端檔案拷貝程式。
synopsis :語法如下
scp [-12346bcpqrv] [-c cipher] [-f ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-p port] [- s program]
[[user@]host1:]file1 ... [[user@]host2:]file2
看到上面各種參數、選項都蒙了吧。不過,沒有關係,我們化整為零,一個一個來分析。
其實,這個指令和我們平常使用的cp 十分的相似。
scp 最簡單的用法就是 scp [[user@]host1:]file1 ... [[user@]host2:]file2 ,看懂麼?
看不懂也沒關係,舉個例子吧: 我要從192.168.1.2的linux 主機的/home/oracle/*.tar 檔案拷貝到192.168.1.3 的linux主機的/home/siebel下,就可以仿照上面的格式寫成:
scp oracle@192.168.1.2:/home/oracle/*.tar siebel@192.168.1.3:/siebel/
輸入了以上指令,回車換行確認,可能會讓你輸入口令,依照提示輸入口令吧。
第一次執行的時候,出現以下錯誤:ssh: connect to host 192.168.1.99 port 22: connection refused, 於是將sshd 程式啟動,執行腳本: # /etc/init.d/sshd start, 成功解決以上問題。
至於該指令的其他參數,平常工作之中基本上用不到,所以,不舉例了,簡單給大家翻譯一下吧,以做參考。
description : 描述
scp copies files between hosts on a network. it uses ssh(1) for data transfer, and uses the same authentication and provides the same security as ssh(1). ccp 1), scp will ask for passwords or passphrases if they are needed for authentication.
scp 在網絡主機之間拷貝數據,她使用ssh(1)來進行數據傳輸,同時使用相同的安全驗證方式。不像 rcp(1), scp 在必要的時候,會問口令。
the options are as follows:
具體的選項如下所示:
-1 forces scp to use protocol 1.
強制scp 使用協定1
#-2 forces scp to use protocol 2.
強制scp 使用協議2
-3 copies between two remote hosts are transferred through the local host.without this option the data is copied
directly between the twoote hosts.note that this option disables the progress meter.
透過本機主機在兩個遠端主機之間傳送資料。沒有這個選項,資料將直接在遠端主機間拷貝資料。注意:這個選項不支援進度條顯示。
-4 forces scp to use ipv4 addresses only.
強制scp只使用ipv4位址。
-6 forces scp to use ipv6 addresses only.
強制scp只使用ipv6位址。
-b selects batch mode (prevents asking for passwords or passphrases).
使用批次模式(避免詢問金鑰或口令)
#-c compression enable.passes the -c flag to ssh(1) to enable compression.
啟用壓縮。傳遞-c參數給ssh以啟用壓縮
-c cipher
selects the cipher to use for encrypting the data transfer.this option is directly passed to ssh(1).
選擇密碼加密資料資料封包傳輸,這個選項直接傳遞給ssh(1)。
-f ssh_config
specifies an alternative per-user configuration file for ssh.this option is directly passed to ssh(1).
為ssh指定一個互動的使用者設定文件,這個選項被使用者設定文件直接傳遞給ssh(1)。
-l limit
limits the used bandwidth, specified in kbit/s.
限制使用的頻寬,以kb為單位。
-p port
specifies the port to connect to on the remote host.
在遠端主機上指定連結連接埠
-q quiet mode
靜默模式:
-r recursively copy entire directories
遞歸拷貝整個目錄
-s program
name of program to use for the encrypted connection.the program must understand ssh(1) options.
用來加密連結的程式。這個程式需要能夠辨識ssh(1)的選項。
exit status
執行後狀態
the scp utility exits 0 on success, and >0 if an error occurs.
scp 工具指令當成功執行後,回傳代碼為0,任何錯誤出現回傳代碼都大於0
以上是linux高階拷貝指令scp怎麼使用的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

Linux系統的五個基本組件是:1.內核,2.系統庫,3.系統實用程序,4.圖形用戶界面,5.應用程序。內核管理硬件資源,系統庫提供預編譯函數,系統實用程序用於系統管理,GUI提供可視化交互,應用程序利用這些組件實現功能。

要查看 Git 倉庫地址,請執行以下步驟:1. 打開命令行並導航到倉庫目錄;2. 運行 "git remote -v" 命令;3. 查看輸出中的倉庫名稱及其相應的地址。

雖然 Notepad 無法直接運行 Java 代碼,但可以通過借助其他工具實現:使用命令行編譯器 (javac) 編譯代碼,生成字節碼文件 (filename.class)。使用 Java 解釋器 (java) 解釋字節碼,執行代碼並輸出結果。

在 Sublime 中運行代碼的方法有六種:通過熱鍵、菜單、構建系統、命令行、設置默認構建系統和自定義構建命令,並可通過右鍵單擊項目/文件運行單個文件/項目,構建系統可用性取決於 Sublime Text 的安裝情況。

Linux的主要用途包括:1.服務器操作系統,2.嵌入式系統,3.桌面操作系統,4.開發和測試環境。 Linux在這些領域表現出色,提供了穩定性、安全性和高效的開發工具。

要安裝 Laravel,需依序進行以下步驟:安裝 Composer(適用於 macOS/Linux 和 Windows)安裝 Laravel 安裝器創建新項目啟動服務訪問應用程序(網址:http://127.0.0.1:8000)設置數據庫連接(如果需要)

自定義開發環境的方法有很多種,但全局 Git 配置文件是最有可能用於自定義設置(例如用戶名、電子郵件、首選文本編輯器和遠程分支)的一種。以下是您需要了解的有關全局 Git 配置文件的關鍵事項。
