# ed music rename

> ed music rename in the Edith ed command line reference. Renames a track or a folder in place.

- Canonical URL: https://getedith.pro/docs/cli/music/rename
- Updated: 2026-12-02

Renames a track or a folder in place.

```
ed music rename <target> <name> [--folder] [--json]
```

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `target` | track path or query, or folder path with `--folder` | required | What to rename. |
| `name` | text | required | The new name, without the extension. |
| `--folder` | flag | off | Rename a folder rather than a track. |
| `--json` | flag | off | Emit JSON on stdout. |

```json
{
  "from": "alpha-song.mp3",
  "to": "Night Drive.mp3"
}
```

```
ed music rename alpha-song.mp3 "Night Drive"
ed music rename "beta tune" Interlude
ed music rename --folder Chill Calm
```

A track keeps its extension, so renaming `alpha-song.mp3` to `Night Drive` gives
`Night Drive.mp3`. A folder has no extension to keep and takes the name as
given. The name is sanitised the same way `mkdir` sanitises it, a blank name
exits 1, and renaming onto a name that already exists exits 1 rather than
overwriting.

Without `--folder` the target goes through the same track resolution `mv` uses,
so an ambiguous query exits 3 with the matches. With `--folder` the target has
to be a real folder path and anything else exits 3. Favourites follow the new
name, folders included, and the running player is told so playback does not
break mid-track.

The empty folder path names the library root. Renaming it is refused and exits
1 with `the library root cannot be renamed`; choose a different root with
`ed music library <path>` so confirmation and live state are updated together.

## Where to go next

- [`ed music`](https://getedith.pro/docs/cli/music), 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
