tigris-objects
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTigris Object Operations
Tigris 对象操作
Quick Reference
快速参考
| Command | Description |
|---|---|
| List objects under a bucket/prefix |
| Copy files local↔remote or remote↔remote |
| Move/rename objects within Tigris |
| Delete objects or folders |
| Create an empty object |
| Show object metadata or storage stats |
| Generate a presigned URL |
| List objects (low-level) |
| Download an object (low-level) |
| Upload an object (low-level) |
| Delete an object (low-level) |
| Update object settings (low-level) |
| 命令 | 描述 |
|---|---|
| 列出存储桶/前缀下的对象 |
| 在本地↔远程或远程↔远程之间复制文件 |
| 在Tigris内移动/重命名对象 |
| 删除对象或文件夹 |
| 创建空对象 |
| 显示对象元数据或存储统计信息 |
| 生成预签名URL |
| 列出对象(底层命令) |
| 下载对象(底层命令) |
| 上传对象(底层命令) |
| 删除对象(底层命令) |
| 更新对象设置(底层命令) |
URI Scheme
URI 格式
Remote paths use or . Bare paths are also accepted.
t3://bucket/keytigris://bucket/keybucket/key远程路径使用 或 。也支持直接使用 格式的路径。
t3://bucket/keytigris://bucket/keybucket/keyUnix-Style Commands (primary interface)
Unix风格命令(主界面)
tigris ls [path]
(alias: list
)
tigris ls [path]listtigris ls [path]
(别名:list
)
tigris ls [path]listList all buckets (no arguments) or objects under a bucket/prefix path.
bash
tigris ls # list all buckets
tigris ls my-bucket # list objects in bucket
tigris ls my-bucket/images/ # list objects under prefix
tigris ls t3://my-bucket/prefix/| Flag | Alias | Description | Default |
|---|---|---|---|
| | Read from a specific bucket snapshot | |
| | Output format ( | |
| Output as JSON |
列出所有存储桶(无参数)或存储桶/前缀路径下的对象。
bash
tigris ls # 列出所有存储桶
tigris ls my-bucket # 列出存储桶中的对象
tigris ls my-bucket/images/ # 列出前缀下的对象
tigris ls t3://my-bucket/prefix/| 标志 | 别名 | 描述 | 默认值 |
|---|---|---|---|
| | 从指定的存储桶快照读取数据 | |
| | 输出格式( | |
| 以JSON格式输出 |
tigris cp <src> <dest>
(alias: copy
)
tigris cp <src> <dest>copytigris cp <src> <dest>
(别名:copy
)
tigris cp <src> <dest>copyCopy files between local filesystem and Tigris, or between paths within Tigris. At least one side must be a remote path. Quote wildcard patterns to prevent shell expansion.
t3://bash
tigris cp ./file.txt t3://my-bucket/file.txt # upload
tigris cp t3://my-bucket/file.txt ./local-copy.txt # download
tigris cp t3://my-bucket/src/ t3://my-bucket/dest/ -r # remote-to-remote
tigris cp ./images/ t3://my-bucket/images/ -r # recursive upload| Flag | Alias | Description |
|---|---|---|
| | Copy directories recursively |
| | Output format ( |
| Output as JSON |
在本地文件系统与Tigris之间,或Tigris内部的路径之间复制文件。至少有一方必须是远程路径。请为通配符模式添加引号,避免shell展开。
t3://bash
tigris cp ./file.txt t3://my-bucket/file.txt # 上传
tigris cp t3://my-bucket/file.txt ./local-copy.txt # 下载
tigris cp t3://my-bucket/src/ t3://my-bucket/dest/ -r # 远程到远程复制
tigris cp ./images/ t3://my-bucket/images/ -r # 递归上传| 标志 | 别名 | 描述 |
|---|---|---|
| | 递归复制目录 |
| | 输出格式( |
| 以JSON格式输出 |
tigris mv <src> <dest>
(alias: move
)
tigris mv <src> <dest>movetigris mv <src> <dest>
(别名:move
)
tigris mv <src> <dest>moveMove (rename) objects within Tigris. Both source and destination must be remote paths. Quote wildcard patterns to prevent shell expansion.
bash
tigris mv t3://my-bucket/old.txt t3://my-bucket/new.txt -f
tigris mv t3://my-bucket/old-dir/ t3://my-bucket/new-dir/ -rf
tigris mv my-bucket/a.txt my-bucket/b.txt -f| Flag | Alias | Description |
|---|---|---|
| | Move directories recursively |
| | Skip confirmation prompt |
| Output format ( | |
| Output as JSON |
在Tigris内移动(重命名)对象。源路径和目标路径都必须是远程路径。请为通配符模式添加引号,避免shell展开。
bash
tigris mv t3://my-bucket/old.txt t3://my-bucket/new.txt -f
tigris mv t3://my-bucket/old-dir/ t3://my-bucket/new-dir/ -rf
tigris mv my-bucket/a.txt my-bucket/b.txt -f| 标志 | 别名 | 描述 |
|---|---|---|
| | 递归移动目录 |
| | 跳过确认提示 |
| 输出格式( | |
| 以JSON格式输出 |
tigris rm <path>
(alias: remove
)
tigris rm <path>removetigris rm <path>
(别名:remove
)
tigris rm <path>removeRemove a bucket, folder, or object from Tigris. A bare bucket name deletes the bucket itself. Quote wildcard patterns to prevent shell expansion.
bash
tigris rm t3://my-bucket/file.txt -f
tigris rm t3://my-bucket/folder/ -rf
tigris rm t3://my-bucket -f # deletes the bucket
tigris rm "t3://my-bucket/logs/*.tmp" -f # wildcard delete| Flag | Alias | Description |
|---|---|---|
| | Remove directories recursively |
| | Skip confirmation prompt |
| Output format ( | |
| Output as JSON |
从Tigris中删除存储桶、文件夹或对象。直接使用存储桶名称会删除存储桶本身。请为通配符模式添加引号,避免shell展开。
bash
tigris rm t3://my-bucket/file.txt -f
tigris rm t3://my-bucket/folder/ -rf
tigris rm t3://my-bucket -f # 删除存储桶
tigris rm "t3://my-bucket/logs/*.tmp" -f # 通配符删除| 标志 | 别名 | 描述 |
|---|---|---|
| | 递归删除目录 |
| | 跳过确认提示 |
| 输出格式( | |
| 以JSON格式输出 |
tigris touch <path>
tigris touch <path>tigris touch <path>
tigris touch <path>Create an empty (zero-byte) object at the given bucket/key path.
bash
tigris touch my-bucket/placeholder.txt
tigris touch t3://my-bucket/logs/| Flag | Alias | Description |
|---|---|---|
| | Output format ( |
| Output as JSON |
在指定的存储桶/键路径下创建一个空(零字节)对象。
bash
tigris touch my-bucket/placeholder.txt
tigris touch t3://my-bucket/logs/| 标志 | 别名 | 描述 |
|---|---|---|
| | 输出格式( |
| 以JSON格式输出 |
tigris stat [path]
tigris stat [path]tigris stat [path]
tigris stat [path]Show storage stats (no args), bucket info, or object metadata.
bash
tigris stat # overall storage stats
tigris stat t3://my-bucket # bucket info
tigris stat t3://my-bucket/my-object.json # object metadata| Flag | Alias | Description | Default |
|---|---|---|---|
| | Read from a specific bucket snapshot | |
| | Output format ( | |
| Output as JSON |
显示存储统计信息(无参数)、存储桶信息或对象元数据。
bash
tigris stat # 整体存储统计信息
tigris stat t3://my-bucket # 存储桶信息
tigris stat t3://my-bucket/my-object.json # 对象元数据| 标志 | 别名 | 描述 | 默认值 |
|---|---|---|---|
| | 从指定的存储桶快照读取数据 | |
| | 输出格式( | |
| 以JSON格式输出 |
Presigned URLs
预签名URL
tigris presign <path>
tigris presign <path>tigris presign <path>
tigris presign <path>Generate a presigned URL for temporary access to an object without credentials.
bash
tigris presign my-bucket/file.txt
tigris presign t3://my-bucket/report.pdf --method put --expires-in 7200
tigris presign my-bucket/image.png --format json
tigris presign my-bucket/data.csv --access-key tid_AaBb| Flag | Alias | Description | Default |
|---|---|---|---|
| | HTTP method ( | |
| | URL expiry time in seconds | |
| Access key ID for signing (resolved from credentials if not provided) | ||
| | Output format ( | |
| Output as JSON |
Use cases:
- Temporary sharing of private objects (GET)
- Client-side uploads without exposing credentials (PUT)
生成预签名URL,无需凭证即可临时访问对象。
bash
tigris presign my-bucket/file.txt
tigris presign t3://my-bucket/report.pdf --method put --expires-in 7200
tigris presign my-bucket/image.png --format json
tigris presign my-bucket/data.csv --access-key tid_AaBb| 标志 | 别名 | 描述 | 默认值 |
|---|---|---|---|
| | HTTP方法( | |
| | URL过期时间(秒) | |
| 用于签名的访问密钥ID(未提供时从凭证中获取) | ||
| | 输出格式( | |
| 以JSON格式输出 |
使用场景:
- 临时共享私有对象(GET)
- 客户端上传时无需暴露凭证(PUT)
Low-Level objects
Subcommand
objects底层objects
子命令
objectsFor programmatic and granular control over individual objects.
用于对单个对象进行程序化和精细化控制。
tigris objects list <bucket>
(alias: l
)
tigris objects list <bucket>ltigris objects list <bucket>
(别名:l
)
tigris objects list <bucket>lList objects in a bucket, optionally filtered by a key prefix.
bash
tigris objects list my-bucket
tigris objects list my-bucket --prefix images/
tigris objects list my-bucket --json| Flag | Alias | Description |
|---|---|---|
| | Filter objects by key prefix |
| | Read from a specific bucket snapshot |
| | Output format ( |
| Output as JSON |
列出存储桶中的对象,可选择按键前缀过滤。
bash
tigris objects list my-bucket
tigris objects list my-bucket --prefix images/
tigris objects list my-bucket --json| 标志 | 别名 | 描述 |
|---|---|---|
| | 按键前缀过滤对象 |
| | 从指定的存储桶快照读取数据 |
| | 输出格式( |
| 以JSON格式输出 |
tigris objects get <bucket> <key>
(alias: g
)
tigris objects get <bucket> <key>gtigris objects get <bucket> <key>
(别名:g
)
tigris objects get <bucket> <key>gDownload an object by key. Prints to stdout by default, or saves to a file with .
--outputbash
tigris objects get my-bucket config.json
tigris objects get my-bucket archive.zip --output ./archive.zip --mode stream| Flag | Alias | Description |
|---|---|---|
| | Output file path (prints to stdout if not specified) |
| | Response mode: |
| | Read from a specific bucket snapshot |
| | Output format ( |
| Output as JSON |
按键下载对象。默认输出到标准输出,使用可保存到文件。
--outputbash
tigris objects get my-bucket config.json
tigris objects get my-bucket archive.zip --output ./archive.zip --mode stream| 标志 | 别名 | 描述 |
|---|---|---|
| | 输出文件路径(未指定时输出到标准输出) |
| | 响应模式: |
| | 从指定的存储桶快照读取数据 |
| | 输出格式( |
| 以JSON格式输出 |
tigris objects put <bucket> <key> <file>
(alias: p
)
tigris objects put <bucket> <key> <file>ptigris objects put <bucket> <key> <file>
(别名:p
)
tigris objects put <bucket> <key> <file>pUpload a local file as an object. Content-type is auto-detected from extension unless overridden.
bash
tigris objects put my-bucket report.pdf ./report.pdf
tigris objects put my-bucket logo.png ./logo.png --access public --content-type image/png| Flag | Alias | Description | Default |
|---|---|---|---|
| | Access level ( | |
| | Content type (auto-detected if omitted) | |
| | Output format ( | |
| Output as JSON |
上传本地文件作为对象。内容类型会根据扩展名自动检测,除非手动覆盖。
bash
tigris objects put my-bucket report.pdf ./report.pdf
tigris objects put my-bucket logo.png ./logo.png --access public --content-type image/png| 标志 | 别名 | 描述 | 默认值 |
|---|---|---|---|
| | 访问级别( | |
| | 内容类型(未指定时自动检测) | |
| | 输出格式( | |
| 以JSON格式输出 |
tigris objects delete <bucket> <key>
(alias: d
)
tigris objects delete <bucket> <key>dtigris objects delete <bucket> <key>
(别名:d
)
tigris objects delete <bucket> <key>dDelete one or more objects by key. Accepts comma-separated keys.
bash
tigris objects delete my-bucket old-file.txt --force
tigris objects delete my-bucket file-a.txt,file-b.txt --force| Flag | Description |
|---|---|
| Skip confirmation prompt |
| Output format ( |
| Output as JSON |
按键删除一个或多个对象。支持逗号分隔的多个键。
bash
tigris objects delete my-bucket old-file.txt --force
tigris objects delete my-bucket file-a.txt,file-b.txt --force| 标志 | 描述 |
|---|---|
| 跳过确认提示 |
| 输出格式( |
| 以JSON格式输出 |
tigris objects set <bucket> <key>
(alias: s
)
tigris objects set <bucket> <key>stigris objects set <bucket> <key>
(别名:s
)
tigris objects set <bucket> <key>sUpdate settings on an existing object such as access level or key name.
bash
tigris objects set my-bucket my-file.txt --access public
tigris objects set my-bucket my-file.txt --access private| Flag | Alias | Description |
|---|---|---|
| | Access level ( |
| | Rename the object to a new key |
| | Output format ( |
| Output as JSON |
更新现有对象的设置,例如访问级别或键名称。
bash
tigris objects set my-bucket my-file.txt --access public
tigris objects set my-bucket my-file.txt --access private| 标志 | 别名 | 描述 |
|---|---|---|
| | 访问级别( |
| | 将对象重命名为新的键 |
| | 输出格式( |
| 以JSON格式输出 |
Common Patterns
常见模式
bash
undefinedbash
undefinedRecursive upload
递归上传
tigris cp ./dist/ t3://my-bucket/static/ -r
tigris cp ./dist/ t3://my-bucket/static/ -r
Download an entire directory
下载整个目录
tigris cp t3://my-bucket/backups/ ./local-backups/ -r
tigris cp t3://my-bucket/backups/ ./local-backups/ -r
Wildcard delete (quote the pattern!)
通配符删除(请为模式添加引号!)
tigris rm "t3://my-bucket/logs/*.tmp" -rf
tigris rm "t3://my-bucket/logs/*.tmp" -rf
Generate a presigned upload URL for client-side uploads
生成预签名上传URL用于客户端上传
tigris presign my-bucket/user-uploads/photo.jpg --method put --expires-in 600
undefinedtigris presign my-bucket/user-uploads/photo.jpg --method put --expires-in 600
undefined