You can use ossutil to quickly upload large files, download files, or batch delete files that have a specific prefix. ossutil runs on operating systems such as Windows, Linux, and macOS. You can download and install the version that is suitable for your environment.
Version
Current version: 2.1.2
Download ossutil
Download link | SHA256 checksum |
3002f1334e65eb3b2b6f31feccc35cb9142c114e276c23371157432a20665201 | |
133bf2dc824b221710f4ff34fdc82b4b8b1b557cf79f2b684ea9e1af4161acaf | |
fddac6d5dcaa8eecde8afa365d73ae5a5538c51b7a3854d79be251483acb2f86 | |
7b0fc62939f6d0a6efb9f8e1d07a8fa4fc45817827628a4624d3b467a7bac5a1 | |
20e685892bcc0b8a3731082409471735641f5359fc55c46890ec882f5441fec8 | |
8de04983ec17c8d1ce7ddfd99e031b7ad69fe385d57d9957f4a10f93f2da73af | |
4b820504c9d5df2486fbb1245a86fd2011f5a098f6795656adfa14d687031323 | |
ea4bf1e8451b6e3d557f968bd77ff26586c95f5f6061fa560cadaff388a775f3 | |
0d84a7f38fbb97f97fbe06a06f3669de3b47082ade9347df4c92a8af1082bb6b |
Install ossutil
Linux
Install ossutil.
Download the ossutil package.
curl -o ossutil-2.1.2-linux-amd64.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.2/ossutil-2.1.2-linux-amd64.zip
NoteThis topic uses ossutil for 64-bit x86 Linux as an example. For the download links for other operating systems, see Download ossutil.
In the directory where you downloaded the package, run the following command to decompress it.
unzip ossutil-2.1.2-linux-amd64.zip
Go to the ossutil-2.1.2-linux-amd64 directory.
cd ossutil-2.1.2-linux-amd64
Run the following command in the current directory.
chmod 755 ossutil
Run the following command to enable global access to ossutil.
sudo mv ossutil /usr/local/bin/ && sudo ln -s /usr/local/bin/ossutil /usr/bin/ossutil
Verify that ossutil is installed.
ossutil
If the ossutil help information is displayed, the installation is successful.
Configure ossutil.
Enter the configuration command.
ossutil config
Set the path of the configuration file as prompted. You can press Enter to use the default path.
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):
By default, ossutil uses /root/.ossutilconfig as the configuration file. If you set a different path for the configuration file, you must add the -c option to specify the configuration file each time you run a command. For example, if the configuration file is saved to /home/config, run the ls command in the following format:
ossutil ls oss://examplebucket -c /home/config
Set the AccessKey ID, AccessKey secret, and region ID as prompted.
Enter the AccessKey ID that you created.
Please enter Access Key ID [****************id]:LTAI****************
Enter the AccessKey secret that you created.
Please enter Access Key Secret [****************sk]:R6vg*********************
Enter the region ID of the data center where your OSS data is stored. If you do not enter a value, the default value cn-hangzhou is used.
Please enter Region [cn-hangzhou]:cn-hangzhou
Enter the endpoint of the data center where your OSS data is stored. If you do not need to use a custom endpoint, you can press Enter to skip this parameter.
After you configure the region information in the preceding step, the public endpoint that corresponds to the region ID is used by default. For example, if you set
region-id
tocn-hangzhou
, the public endpointhttps://oss-cn-hangzhou.aliyuncs.com
is used by default.To use a custom endpoint for the region where the OSS data center is located, enter your endpoint information. For example, if you want to access OSS from other Alibaba Cloud products in the same region, use an internal endpoint such as
https://oss-cn-hangzhou-internal.aliyuncs.com
.Please enter Endpoint (optional, use public endpoint by default) [None]: https://oss-cn-hangzhou-internal.aliyuncs.com
The following table describes the parameters.
Parameter
Required
Description
accessKeyID
Yes
The AccessKey of your account. For more information about how to obtain an AccessKey, see Create an AccessKey.
accessKeySecret
Yes
Region
Yes
Enter the region ID of the bucket. This topic uses the China (Hangzhou) region as an example. The region ID is set to cn-hangzhou. For more information about the IDs of other regions, see OSS regions and endpoints.
endpoint
No
Enter the endpoint of the region where the bucket is located. For example, to use the public endpoint of the China (Hangzhou) region in this example, set this parameter to
https://oss-cn-hangzhou.aliyuncs.com
.If you want to access OSS from other Alibaba Cloud products in the same region, use the internal endpoint. For example, set this parameter to
https://oss-cn-hangzhou-internal.aliyuncs.com
.For more information about the endpoints of different regions, see OSS regions and endpoints.
Windows
Install ossutil.
Download the installation package that corresponds to your system architecture or version:
x86_32 architecture: Windows x86 32bit.
x86_64 architecture: Windows x86 64bit.
For Windows 7, Windows 8, and Windows Server 2008R2, download the following package: Windows 7, Windows 8, Windows Server 2008R2.
Decompress the downloaded .zip package to a destination folder. Then, go to the directory where you decompressed the package, as shown in the following figure.
Copy the path of the ossutil folder where you decompressed the package and configure a system environment variable.
Click the path bar of the current directory and copy the path of the current folder.
Open the Environment Variables dialog box. In the System Variables section, find and double-click the Path variable. Click the New button, and then paste the copied path of the ossutil folder into the new entry box.
Open the command line and run the
ossutil
command. If the ossutil help information is displayed, the installation is successful.ossutil
Configure ossutil.
Enter the configuration command.
ossutil config
Set the path of the configuration file as prompted. You can press Enter to use the default path.
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):
By default, ossutil uses C:\Users\issuser\.ossutilconfig as the configuration file. If you set a different path for the configuration file, you must add the -c option to specify the configuration file each time you run a command. For example, if the configuration file is saved to c:\ossutil\config, run the ls command in the following format:
ossutil ls oss://examplebucket -c c:\ossutil\config
Set the AccessKey ID, AccessKey secret, and region ID as prompted.
Enter the AccessKey ID that you created.
Please enter Access Key ID [****************id]:LTAI****************
Enter the AccessKey secret that you created.
Please enter Access Key Secret [****************sk]:R6vg*********************
Enter the region ID of the data center where your OSS data is stored. If you do not enter a value, the default value cn-hangzhou is used.
Please enter Region [cn-hangzhou]:cn-hangzhou
Enter the endpoint of the data center where your OSS data is stored. If you do not need to use a custom endpoint, you can press Enter to skip this parameter.
After you configure the region information in the preceding step, the public endpoint that corresponds to the region ID is used by default. For example, if you set
region-id
tocn-hangzhou
, the public endpointhttps://oss-cn-hangzhou.aliyuncs.com
is used by default.To use a custom endpoint for the region where the OSS data center is located, enter your endpoint information. For example, if you want to access OSS from other Alibaba Cloud products in the same region, use an internal endpoint such as
https://oss-cn-hangzhou-internal.aliyuncs.com
.Please enter Endpoint (optional, use public endpoint by default) [None]: https://oss-cn-hangzhou-internal.aliyuncs.com
The following table describes the parameters.
Parameter
Required
Description
accessKeyID
Yes
The AccessKey of your account. For more information about how to obtain an AccessKey, see Create an AccessKey.
accessKeySecret
Yes
Region
Yes
Enter the region ID of the bucket. This topic uses the China (Hangzhou) region as an example. The region ID is set to cn-hangzhou. For more information about the IDs of other regions, see OSS regions and endpoints.
endpoint
No
Enter the endpoint of the region where the bucket is located. For example, to use the public endpoint of the China (Hangzhou) region in this example, set this parameter to
https://oss-cn-hangzhou.aliyuncs.com
.If you want to access OSS from other Alibaba Cloud products in the same region, use the internal endpoint. For example, set this parameter to
https://oss-cn-hangzhou-internal.aliyuncs.com
.For more information about the endpoints of different regions, see OSS regions and endpoints.
macOS
Install ossutil.
Download the ossutil package.
curl -o ossutil-2.1.2-mac-arm64.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.2/ossutil-2.1.2-mac-arm64.zip
NoteThis topic uses ossutil for 64-bit ARM macOS as an example. For the download links for other operating systems, see Download ossutil.
In the directory where you downloaded the package, run the following command to decompress it.
unzip ossutil-2.1.2-mac-arm64.zip
Go to the ossutil-2.1.2-mac-arm64 directory.
cd ossutil-2.1.2-mac-arm64
Run the following command in the current directory.
chmod 755 ossutil
Run the following command to enable global access to ossutil.
sudo mv ossutil /usr/local/bin/ && sudo ln -s /usr/local/bin/ossutil /usr/bin/ossutil
Verify that ossutil is installed.
ossutil
If the ossutil help information is displayed, the installation is successful.
Configure ossutil.
Enter the configuration command.
ossutil config
Set the path of the configuration file as prompted. You can press Enter to use the default path.
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):
By default, ossutil uses /Users/user/.ossutilconfig as the configuration file. If you set a different path for the configuration file, you must add the -c option to specify the configuration file each time you run a command. For example, if the configuration file is saved to /home/config, run the ls command in the following format:
ossutil ls oss://examplebucket -c /home/config
Set the AccessKey ID, AccessKey secret, and region ID as prompted.
Enter the AccessKey ID that you created.
Please enter Access Key ID [****************id]:LTAI****************
Enter the AccessKey secret that you created.
Please enter Access Key Secret [****************sk]:R6vg*********************
Enter the region ID of the data center where your OSS data is stored. If you do not enter a value, the default value cn-hangzhou is used.
Please enter Region [cn-hangzhou]:cn-hangzhou
Enter the endpoint of the data center where your OSS data is stored. If you do not need to use a custom endpoint, you can press Enter to skip this parameter.
After you configure the region information in the preceding step, the public endpoint that corresponds to the region ID is used by default. For example, if you set
region-id
tocn-hangzhou
, the public endpointhttps://oss-cn-hangzhou.aliyuncs.com
is used by default.To use a custom endpoint for the region where the OSS data center is located, enter your endpoint information. For example, if you want to access OSS from other Alibaba Cloud products in the same region, use an internal endpoint such as
https://oss-cn-hangzhou-internal.aliyuncs.com
.Please enter Endpoint (optional, use public endpoint by default) [None]: https://oss-cn-hangzhou-internal.aliyuncs.com
The following table describes the parameters.
Parameter
Required
Description
accessKeyID
Yes
The AccessKey of your account. For more information about how to obtain an AccessKey, see Create an AccessKey.
accessKeySecret
Yes
Region
Yes
Enter the region ID of the bucket. This topic uses the China (Hangzhou) region as an example. The region ID is set to cn-hangzhou. For more information about the IDs of other regions, see OSS regions and endpoints.
endpoint
No
Enter the endpoint of the region where the bucket is located. For example, to use the public endpoint of the China (Hangzhou) region in this example, set this parameter to
https://oss-cn-hangzhou.aliyuncs.com
.If you want to access OSS from other Alibaba Cloud products in the same region, use the internal endpoint. For example, set this parameter to
https://oss-cn-hangzhou-internal.aliyuncs.com
.For more information about the endpoints of different regions, see OSS regions and endpoints.