Skip to content

bhatti file ls

List directory contents inside a sandbox.

Synopsis

bhatti file ls <sandbox> <path>

Description

Lists files and subdirectories at the given absolute path. The default human format prints one row per entry: a directory flag, mode, size in bytes, and name.

Listings are capped at 10 000 entries. If the directory has more entries than that, a sentinel row indicates truncation. For listings with this many entries you almost certainly want to be running find inside the sandbox via bhatti exec and processing the results there instead.

Examples

bhatti file ls dev /workspace
drwxr-xr-x     4096 node_modules
-rw-r--r--     1234 app.js
-rw-r--r--      256 package.json
-rw-r--r--      512 README.md
# JSON for scripting
bhatti file ls dev /workspace --json | jq '.[] | select(.is_dir == false) | .name'

Output fields (JSON)

[
  {"name": "app.js", "size": 1234, "mode": "0644", "is_dir": false, "mtime": 1761792345},
  {"name": "node_modules", "size": 4096, "mode": "0755", "is_dir": true, "mtime": 1761792500}
]

mtime is a Unix timestamp in seconds.

Options

This command takes only global flags. See Global flags for --url, --token, --json, --timing, --data-dir.

See also