Available in Classic and VPC
Get information about an account, container (bucket), or object.
Syntax
The stat syntax is as follows:
-
Account
swift stat \ [--lh] \ [--header <header:value>] -
Container
swift stat \ <container> \ [--lh] \ [--header <header:value>] -
Object
swift stat \ <container> <object> \ [--lh] \ [--header <header:value>]
Options
This section describes the options available when running stat.
Required options
The following options are required for stat.
| Options | Type | Required | Description |
|---|---|---|---|
<container> |
String | Conditional | Container name
|
Optional options
These are the optional options for stat. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
<object> |
String | Optional | Object name
|
--lh |
Boolean | Optional | Displays the size in an easy-to-read unit. |
--header |
String | Optional | Custom header to use in information retrieval requests
|
Common options
For information about the options common to all swift subcommands, see Archive Storage options.
Examples
When you run the command, the identification information and metadata for the query target are displayed.
Command
The following is an example command for retrieving account information.
swift stat
The following is an example command for retrieving object information.
swift stat test-container-01 sample.txt
Output
The following is an example output for retrieving account information.
Account: AUTH_a1b2c3d4e5f64a7b8c9d0e1f2a3b4c5d
Containers: 1
Objects: 1
Bytes: 22
Containers in policy "standard00": 1
Objects in policy "standard00": 1
Bytes in policy "standard00": 22
Content-Type: application/json; charset=utf-8
X-Timestamp: 1787104388.45305
Accept-Ranges: bytes
X-Account-Project-Domain-Id: default
X-Trans-Id: tx1a2b3c4d5e6f7890abcde-00a1b2c3d4
X-Openstack-Request-Id: tx1a2b3c4d5e6f7890abcde-00a1b2c3d4
The following is an example output for retrieving object information.
Account: AUTH_a1b2c3d4e5f64a7b8c9d0e1f2a3b4c5d
Container: test-container-01
Object: sample.txt
Content Type: text/plain
Content Length: 54
Last Modified: Wed, 19 Aug 2026 01:53:20 GMT
ETag: 448575206ef0bb80c79087a7e85c1f5c
Meta Mtime: 1787104388.114041
X-Timestamp: 1787104399.90791
Accept-Ranges: bytes
X-Trans-Id: tx2b3c4d5e6f7a8901bcdef-00b2c3d4e5
X-Openstack-Request-Id: tx2b3c4d5e6f7a8901bcdef-00b2c3d4e5