You can run terminal commands inside the sandbox using the commands.run() method.
import { Sandbox } from 'e2b'const sandbox = await Sandbox.create()const result = await sandbox.commands.run('ls -l')console.log(result)
from e2b import Sandboxsandbox = Sandbox.create()result = sandbox.commands.run('ls -l')print(result)
Custom shell
By default, commands run in a Bash login shell (/bin/bash -l -c <cmd>). Pass the shell option to run the command with a different executable and arguments; the command is appended as the last argument.