# ed machines services ls

> Lists the systemd service units on a machine. It is the default subcommand of services, so ed machines services devbox runs it.

- Canonical URL: https://getedith.pro/docs/cli/machines-power/services-ls
- Updated: 2026-12-02

Lists the systemd service units on a machine. It is the default subcommand of
`services`, so `ed machines services devbox` runs it. Also spelled
`ed machines services list`.

```
ed machines services ls <machine> [--failed] [--json]
```

## Arguments

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `<machine>` | machine name, ssh alias or id | required | Which machine to list units on. |

## Options

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `--failed` | flag | off | Only failed units, meaning those whose `active` or `sub` field is `failed`. Filtered on this Mac after the full list arrives. |
| `--json` | flag | off | Emit JSON on stdout instead of the table. |
| `--help`, `-h` | flag | off | Print the help for this command on stdout and exit 0. |

```
$ ed machines services devbox
UNIT                       ACTIVE  SUB      WHAT
cron.service               active  running  Regular background program processing daemon
docker.service             active  running  Docker Application Container Engine
nginx.service              active  running  A high performance web server
ollama.service             failed  failed   Ollama Service
ssh.service                active  running  OpenBSD Secure Shell server
systemd-timesyncd.service  active  running  Network Time Synchronization
```

## `--json` shape

A top-level array, one object per unit, in the order `systemctl` returned them:

```json
[
  {
    "active": "active",
    "description": "A high performance web server",
    "failed": false,
    "load": "loaded",
    "running": true,
    "sub": "running",
    "unit": "nginx.service"
  },
  {
    "active": "failed",
    "description": "Ollama Service",
    "failed": true,
    "load": "loaded",
    "running": false,
    "sub": "failed",
    "unit": "ollama.service"
  }
]
```

`load`, `active` and `sub` are systemd's own three columns, passed through
untouched. `running` is `sub == "running"` and `failed` is
`active == "failed" || sub == "failed"`, both precomputed so a script does not
have to know systemd's vocabulary. The JSON key is `description`; the table
column is headed `WHAT`.

## Examples

```
ed machines services devbox
ed machines services ls devbox --failed
ed machines devbox services ls
ed machines services ls devbox --json | jq -r '.[] | select(.failed) | .unit'
```

## Behaviour notes

The remote line is this, with a 30 second timeout:

```
systemctl list-units --type=service --all --no-pager --no-legend --plain 2>/dev/null | head -200
```

Three consequences worth knowing.

The list is capped at 200 units and there is no flag to raise it. A machine with
more services than that loses the tail silently.

Only `.service` units are listed. Timers, sockets, mounts and targets are not,
because the parser drops any line whose first field does not end in `.service`.

A machine with no systemd at all reports nothing rather than failing. The
`2>/dev/null` swallows the "command not found" and `head` exits 0, so you get a
note on stderr and exit 0:

```
$ ed machines services ls box
no systemd units reported
```

`--failed` narrows the list here, on this Mac, after all 200 lines have crossed
the wire. It is not `systemctl --failed`, so it costs the same as the full list.

## Where to go next

- [`ed machines power`](https://getedith.pro/docs/cli/machines-power), the rest of this group
- [All `ed` commands](https://getedith.pro/docs/cli)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
