# List sandboxes (/docs/cli/list-sandboxes)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 338 · updated: 2026-07-30 -->
Related: [Authentication in CLI](/docs/cli/auth.md), [Connect to sandbox](/docs/cli/connect-to-sandbox.md), [Create sandbox](/docs/cli/create-sandbox.md), [Execute commands in sandbox](/docs/cli/exec-command.md), [Shutdown running sandboxes](/docs/cli/shutdown-sandboxes.md)

You can list all sandboxes using the following command:

<CodeGroup>
  <CodeBlockTabs defaultValue="Terminal" groupId="terminal">
    <CodeBlockTabsList>
      <CodeBlockTabsTrigger value="Terminal">
        Terminal
      </CodeBlockTabsTrigger>
    </CodeBlockTabsList>

    <CodeBlockTab value="Terminal">
      ```bash  terminal 
      e2b sandbox list
      ```
    </CodeBlockTab>
  </CodeBlockTabs>
</CodeGroup>

This will return running sandboxes, you can specify `--state` to get paused or both.

### Filter by state [#filter-by-state]

To filter the sandboxes by their state you can specify the `--state` flag, which can either be "**running**", "**paused**" or both.

```bash
e2b sandbox list --state running,paused
```

### Filter by metadata [#filter-by-metadata]

To filter the sandboxes by their metadata, use the `--metadata` flag.

```bash
e2b sandbox list --metadata key1=value1,key2=value2
```

### List limit [#list-limit]

To limit the amount of sandboxes returned by the command, use the `--limit` flag.

```bash
e2b sandbox list --limit 10
```

By default, the command will return all sandboxes.

### Output format [#output-format]

To output the sandboxes in JSON format, use the `--format` flag.

**Pretty print (default)**

```bash
e2b sandbox list --format pretty
```

**JSON**

```bash
e2b sandbox list --format json
```
