> ## Documentation Index
> Fetch the complete documentation index at: https://e2b.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://e2b.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://e2b.manicule.dev/api/mcp.
> Every agent surface: https://e2b.manicule.dev/.well-known/llms-manifest.json

# Running commands in sandbox (/docs/commands)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 109 · updated: 2026-07-30 -->
Related: [API key](/docs/api-key.md), [Billing & limits](/docs/billing.md), [E2B CLI](/docs/cli.md), [Cookbook](https://github.com/e2b-dev/e2b-cookbook), [Filesystem](/docs/filesystem.md), [Overview](/docs/mcp.md)

You can run terminal commands inside the sandbox using the `commands.run()` method.

<CodeGroup>
```js title="JavaScript & TypeScript"
import { Sandbox } from 'e2b'

const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('ls -l')
console.log(result)
```

```python title="Python"
from e2b import Sandbox

sandbox = Sandbox.create()
result = sandbox.commands.run('ls -l')
print(result)
```
</CodeGroup>
