三多运维

Ubuntu系统下命令行工具ossutil快速入门

Nov 04, 2025
3
0
root@iZm5eg81qbj43ewlci4sqaZ:~# cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
root@iZm5eg81qbj43ewlci4sqaZ:~# apt install unzip -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
unzip is already the newest version (6.0-26ubuntu3.2).
....
root@iZm5eg81qbj43ewlci4sqaZ:~# 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
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9568k  100 9568k    0     0  31.8M      0 --:--:-- --:--:-- --:--:-- 31.8M
root@iZm5eg81qbj43ewlci4sqaZ:~# ll 
total 174784
dr-xr-x---  8 root root      4096 Nov  4 09:27 ./
drwxr-xr-x 22 root root      4096 Nov  2  2024 ../
-rw-r--r--  1 root root   9797653 Nov  4 09:27 ossutil-2.1.2-linux-amd64.zip

root@iZm5eg81qbj43ewlci4sqaZ:~# unzip ossutil-2.1.2-linux-amd64.zip 
Archive:  ossutil-2.1.2-linux-amd64.zip
   creating: ossutil-2.1.2-linux-amd64/
  inflating: ossutil-2.1.2-linux-amd64/ossutil  
root@iZm5eg81qbj43ewlci4sqaZ:~# cd ossutil-2.1.2-linux-amd64/
root@iZm5eg81qbj43ewlci4sqaZ:~/ossutil-2.1.2-linux-amd64# chmod 755 ossutil 
root@iZm5eg81qbj43ewlci4sqaZ:~/ossutil-2.1.2-linux-amd64# ll
total 18796
drwxr-xr-x 2 root root     4096 Jul 25 10:46 ./
dr-xr-x--- 9 root root     4096 Nov  4 09:28 ../
-rwxr-xr-x 1 root root 19238182 Jul 25 10:46 ossutil*
root@iZm5eg81qbj43ewlci4sqaZ:~/ossutil-2.1.2-linux-amd64# mv ossutil /usr/local/bin/ && ln -s /usr/local/bin/ossutil /usr/bin/ossutil
root@iZm5eg81qbj43ewlci4sqaZ:~/ossutil-2.1.2-linux-amd64# ossutil 

ossutil is a tool for managing OSS (Object Storage Service) data.

Usage: ossutil [command]

Available Commands:
  api         The API-level commands
  append      Append content to a appendable object
  cat         Concatenate an object to standard output
  config      Creates a config file and stores configuration settings and credentials
  cp          Upload, Download or Copy Objects
  du          Get the bucket or the specified prefix(directory) storage size
  hash        Get the hash value of file
  ls          List buckets or objects
  mb          Creates a bucket
  mkdir       Create an object with name suffix '/'
  presign     Generate a pre-signed URL for object
  probe       Detection command
  rb          Delete bucket
  restore     Restore frozen state object to read ready status
  revert      Revert the deleted object to the latest versioning state
  rm          Deletes objects
  set-props   Set the property of objects
  stat        Display meta information of bucket or objects
  sync        Sync the local file directory or objects from the source to the destination
  unrestore   Clean an object restored from Archive or Cold Archive state
  update      Update ossutil
  version     Show version

Additional help topics:
  filter      more information about filter flags, and how to use it in commands

Use "ossutil [command] --help" for more information about a command.
Use "ossutil [topic]" for more information about a topic.

0.000675(s) elapsed
返回ossutil的帮助信息即表示安装成功。