---
sidebar_position: 14
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lium.io/llms.txt
> Use this file to discover all available pages before exploring further.

# `lium exec`

Execute a command on one or more pods.

```bash
lium exec POD COMMAND [OPTIONS]
```

## Arguments

- `POD` — Pod name, index, comma-separated list, or `all`.
- `COMMAND` — The command to execute on the pod.

## Options

| Flag | Effect |
|------|--------|
| `--timeout SECONDS` | Abort if the command runs longer than this |
| `--output FILE` | Save combined stdout/stderr to a local file |

## Examples

```bash
lium exec my-pod "python train.py"
lium exec 1 "nvidia-smi" --output gpu_info.txt
lium exec 1,2,3 "apt update"            # Multiple pods
lium exec all "pip install numpy"       # Every running pod
```

## See also

- [`lium ssh`](./ssh) — interactive shell
- [`lium scp`](./scp) — push code first, then `exec`
