當您需要快速上傳大檔案、下載檔案、刪除固定首碼檔案時,可以使用ossutil工具。ossutil支援在Windows、Linux、macOS等系統中運行,您可以根據實際環境下載和安裝合適的版本。
版本
目前的版本:2.0.6-beta.01091200
下載ossutil
下載地址 | SHA256校正和 |
7f995a199daa964da2ea3552413ab3c8bd16fd3947beef123a9184515a4b7410 | |
17991f8df09b0ca9c5d26d62be7dcb682f2963041f609351860b26259c6fa057 | |
2112346bbaa379291d96353f657659c99ee6758cad99435f3162eb9c23ce5561 | |
8ab900bb4cc73be43aa317d76a2d21f0650600b7a474e524fbb2e6e8ddc13d41 | |
0271a091d068c135b23927faa21e2b826d8e0b629ea7d84a2927577c03a56187 | |
8d958e96162dc8541fd99a4a501cac2b9344a95c2f95c57c5d8566f35f45d949 | |
6338cac0d260dc5ad3fcec65c7bd68f2b2458efd5d1b2e626eeb74e30adc1ec7 | |
45e4f9903f760c28cd1d37c1fbbfb91c0e75966509d33a144a53ae05f33d94c7 | |
c2aa344d14206cf4914274d72e6cc1a3bae75d7a8d03430cbb729cda006afb76 |
安裝ossutil
Linux
安裝ossutil。
下載ossutil壓縮包。
curl -o ossutil-2.0.6-beta.01091200-linux-amd64.zip https://gosspublic.alicdn.com/ossutil/v2-beta/2.0.6-beta.01091200/ossutil-2.0.6-beta.01091200-linux-amd64.zip
說明此處以Linux x86 64bit為例進行介紹。其他系統下載地址,請參見下載ossutil。
在下載壓縮包的所在目錄執行以下解壓命令。
unzip ossutil-2.0.6-beta.01091200-linux-amd64.zip
進入ossutil-2.0.6-beta.01091200-linux-amd64目錄。
cd ossutil-2.0.6-beta.01091200-linux-amd64
在目前的目錄執行以下命令。
chmod 755 ossutil
執行以下命令,實現ossutil的全域調用。
sudo mv ossutil /usr/local/bin/ && sudo ln -s /usr/local/bin/ossutil /usr/bin/ossutil
驗證是否成功安裝ossutil。
ossutil
返回ossutil的協助資訊即表示安裝成功。
配置ossutil。
輸入配置命令。
ossutil config
根據提示設定設定檔路徑。您可以直接斷行符號使用預設的設定檔路徑。
Please enter the config file name,the file name can include path(default /root/.ossutilconfig, carriage return will use the default file. If you specified this option to other file, you should specify --config-file option to the file when you use other commands):
ossutil預設使用/root/.ossutilconfig作為設定檔,若您設定了設定檔的路徑,則每次使用命令時需增加-c選項指定設定檔。例如設定檔儲存為/home/config,使用ls時,命令格式如下:
ossutil ls oss://examplebucket -c /home/config
根據提示分別設定AccessKey ID、AccessKey Secret、地區等資訊。
輸入您建立的AccessKey ID。
Please enter Access Key ID [****************id]:LTAI****************
輸入您建立的AccessKey Secret。
Please enter Access Key Secret [****************sk]:R6vg*********************
輸入您的OSS的資料中心所在的地區,如無任何輸入,預設值為cn-hangzhou。
Please enter Region [cn-hangzhou]:cn-hangzhou
如果您不需要自訂 Endpoint,可以直接按斷行符號跳過該參數的配置。在上一步配置完地區資訊後,將預設使用該地區 ID 對應的外網 Endpoint。例如,如果您設定的
region-id
為cn-hangzhou
,預設使用的外網 Endpoint 是https://oss-cn-hangzhou.aliyuncs.com
。如果您需要自訂 OSS 資料中心所在地區的 Endpoint,請輸入您的 Endpoint 資訊。Please enter Endpoint (optional, use public endpoint by default) [None]: https://oss-cn-hangzhou.aliyuncs.com
參數說明如下:
參數
是否必填
說明
accessKeyID
是
填寫帳號的AccessKey,AccessKey的擷取方式,請參見建立AccessKey。
accessKeySecret
是
Region
是
填寫Bucket所在的地區ID,本文以杭州地區為例,其他地區的ID參見OSS地區和訪問網域名稱。
endpoint
否
填寫Bucket所在地區的Endpoint。關於各地區Endpoint的更多資訊,請參見OSS地區和訪問網域名稱。
Windows
安裝ossutil。
請根據您的系統架構或系統版本下載對應的安裝包:
x86_32架構:Windows x86 32bit。
x86_64架構:Windows x86 64bit。
Windows 7、Windows8以及Windows Server 2008R2系統版本請下載:Windows 7, Windows 8, Windows Server 2008R2。
將下載好的.zip壓縮包解壓到目標檔案夾,然後進入解壓後的目錄,如圖所示。
複製當前解壓後ossutil檔案夾路徑配置系統內容變數。
單擊目前的目錄的路徑欄,複製其中顯示的當前檔案夾路徑。
開啟環境變數對話方塊,在系統變數欄中找到並雙擊Path變數,單擊建立按鈕,然後將複製好的ossutil檔案夾路徑粘貼到新的條目框中。
開啟命令列,執行
ossutil
命令,返回ossutil的協助資訊即表示安裝成功。ossutil
配置ossutil。
輸入配置命令。
ossutil config
根據提示設定設定檔路徑。您可以直接斷行符號使用預設的設定檔路徑。
Please enter the config file name,the file name can include path(default "C:\Users\issuser\.ossutilconfig", carriage return will use the default file. If you specified this option to other file, you should specify --config-file option to the file when you use other commands):
ossutil預設使用C:\Users\issuser\.ossutilconfig作為設定檔,若您設定了設定檔的路徑,則每次使用命令時需增加-c選項指定設定檔。例如設定檔儲存為c:\ossutil\config,使用ls時,命令格式如下:
ossutil ls oss://examplebucket -c c:\ossutil\config
根據提示分別設定AccessKey ID、AccessKey Secret、地區等資訊。
輸入您建立的AccessKey ID。
Please enter Access Key ID [****************id]:LTAI****************
輸入您建立的AccessKey Secret。
Please enter Access Key Secret [****************sk]:R6vg*********************
輸入您的OSS的資料中心所在的地區,如無任何輸入,預設值為cn-hangzhou。
Please enter Region [cn-hangzhou]:cn-hangzhou
如果您不需要自訂 Endpoint,可以直接按斷行符號跳過該參數的配置。在上一步配置完地區資訊後,將預設使用該地區 ID 對應的外網 Endpoint。例如,如果您設定的
region-id
為cn-hangzhou
,預設使用的外網 Endpoint 是https://oss-cn-hangzhou.aliyuncs.com
。如果您需要自訂 OSS 資料中心所在地區的 Endpoint,請輸入您的 Endpoint 資訊。Please enter Endpoint (optional, use public endpoint by default) [None]: https://oss-cn-hangzhou.aliyuncs.com
參數說明如下:
參數
是否必填
說明
accessKeyID
是
填寫帳號的AccessKey,AccessKey的擷取方式,請參見建立AccessKey。
accessKeySecret
是
Region
是
填寫Bucket所在的地區ID,本文以杭州地區為例,其他地區的ID參見OSS地區和訪問網域名稱。
endpoint
否
填寫Bucket所在地區的Endpoint。關於各地區Endpoint的更多資訊,請參見OSS地區和訪問網域名稱。
macOS
安裝ossutil。
下載ossutil壓縮包。
curl -o ossutil-2.0.6-beta.01091200-mac-arm64.zip https://gosspublic.alicdn.com/ossutil/v2-beta/2.0.6-beta.01091200/ossutil-2.0.6-beta.01091200-mac-arm64.zip
說明此處以macOS ARM 64bit為例進行介紹。其他系統下載地址,請參見下載ossutil。
在下載壓縮包的所在目錄執行以下解壓命令。
unzip ossutil-2.0.6-beta.01091200-mac-arm64.zip
進入ossutil-2.0.6-beta.01091200-mac-arm64目錄。
cd ossutil-2.0.6-beta.01091200-mac-arm64
在目前的目錄執行以下命令。
chmod 755 ossutil
執行以下命令,實現ossutil的全域調用。
sudo mv ossutil /usr/local/bin/ && sudo ln -s /usr/local/bin/ossutil /usr/bin/ossutil
驗證是否成功安裝ossutil。
ossutil
返回ossutil的協助資訊即表示安裝成功。
配置ossutil。
輸入配置命令。
ossutil config
根據提示設定設定檔路徑。您可以直接斷行符號使用預設的設定檔路徑。
Please enter the config file name,the file name can include path(default "/Users/user/.ossutilconfig", carriage return will use the default file. If you specified this option to other file, you should specify --config-file option to the file when you use other commands):
ossutil預設使用/Users/user/.ossutilconfig作為設定檔,若您設定了設定檔的路徑,則每次使用命令時需增加-c選項指定設定檔。例如設定檔儲存為/home/config,使用ls時,命令格式如下:
ossutil ls oss://examplebucket -c /home/config
根據提示分別設定AccessKey ID、AccessKey Secret、地區等資訊。
輸入您建立的AccessKey ID。
Please enter Access Key ID [****************id]:LTAI****************
輸入您建立的AccessKey Secret。
Please enter Access Key Secret [****************sk]:R6vg*********************
輸入您的OSS的資料中心所在的地區,如無任何輸入,預設值為cn-hangzhou。
Please enter Region [cn-hangzhou]:cn-hangzhou
如果您不需要自訂 Endpoint,可以直接按斷行符號跳過該參數的配置。在上一步配置完地區資訊後,將預設使用該地區 ID 對應的外網 Endpoint。例如,如果您設定的
region-id
為cn-hangzhou
,預設使用的外網 Endpoint 是https://oss-cn-hangzhou.aliyuncs.com
。如果您需要自訂 OSS 資料中心所在地區的 Endpoint,請輸入您的 Endpoint 資訊。Please enter Endpoint (optional, use public endpoint by default) [None]: https://oss-cn-hangzhou.aliyuncs.com
參數說明如下:
參數
是否必填
說明
accessKeyID
是
填寫帳號的AccessKey,AccessKey的擷取方式,請參見建立AccessKey。
accessKeySecret
是
Region
是
填寫Bucket所在的地區ID,本文以杭州地區為例,其他地區的ID參見OSS地區和訪問網域名稱。
endpoint
否
填寫Bucket所在地區的Endpoint。關於各地區Endpoint的更多資訊,請參見OSS地區和訪問網域名稱。