Usage
Options
Snapshot ID to list files from. Can be:
- Full snapshot hash (e.g.,
a3f8d2e1...) - Short prefix (e.g.,
a3f8d2) latest(default) — lists files from the most recent snapshot
Global Options
- Storage backend configuration (
-store,-store-path, etc.) - Encryption credentials (
-encryption-password,-encryption-key, etc.) - Verbosity flags (
-verbose,-quiet,-debug)
Enable verbose output showing detailed progress while loading file metadata.
Examples
Output
The command displays a hierarchical tree of all files and directories in the snapshot:Tree Structure
- Directories are shown without a size
- Files are shown with their uncompressed size in parentheses
- Files and directories are sorted alphabetically within each level
- Indentation shows the directory hierarchy
File sizes shown are the original uncompressed sizes, not the deduplicated/compressed size in the repository.
Snapshot Selection
You can specify snapshots in multiple ways:By Full Hash
By Short Prefix
By “latest”
Use Cases
Finding Files
Browse the snapshot tree to find specific files before restoring:Verifying Backups
Confirm that expected files were included in a backup:Comparing Snapshots
List files from different snapshots to see what changed:cloudstic diff command for structured comparison:
Performance
Thels command must load all file metadata from the snapshot to build the tree. Performance depends on:
- File count — More files take longer to load
- Storage backend — Cloud storage (S3/B2) is slower than local storage
- HAMT depth — Deeper trees require more object fetches
- 1,000 files: less than 1 second (local storage)
- 10,000 files: 2-5 seconds (cloud storage)
- 100,000 files: 20-60 seconds (cloud storage)
HAMT Tree Structure
Cloudstic stores file metadata in a persistent Hash Array Mapped Trie (HAMT):- Files are indexed by their path (e.g.,
documents/report.pdf) - Each HAMT node is a separate object in the repository
- The tree structure provides efficient lookups and updates
- Only changed subtrees are rewritten during backups (structural sharing)
ls command recursively walks the HAMT tree from the snapshot’s root node to build the full file listing.
Encryption
If your repository is encrypted, you must provide valid credentials:ls command decrypts objects as needed to build the tree.
Machine-Readable Output
For scripting and automation, the tree output can be parsed, but consider using the raw snapshot object for structured data:Size Formatting
File sizes are displayed in human-readable format:- B — Bytes (< 1 KiB)
- KiB — Kibibytes (1024 bytes)
- MiB — Mebibytes (1024 KiB)
- GiB — Gibibytes (1024 MiB)
- TiB — Tebibytes (1024 GiB)
See Also
- cloudstic list — List all backup snapshots
- cloudstic restore — Restore files from a snapshot
- cloudstic diff — Compare two snapshots to see what changed
- cloudstic cat — Display raw JSON for snapshot objects