| 1 |
# The clean command |
| 2 |
|
| 3 |
The clean command is used to delete the generated book and any other build |
| 4 |
artifacts. |
| 5 |
|
| 6 |
```bash |
| 7 |
mdbook clean |
| 8 |
``` |
| 9 |
|
| 10 |
#### Specify a directory |
| 11 |
|
| 12 |
The `clean` command can take a directory as an argument to use as the book's |
| 13 |
root instead of the current working directory. |
| 14 |
|
| 15 |
```bash |
| 16 |
mdbook clean path/to/book |
| 17 |
``` |
| 18 |
|
| 19 |
#### `--dest-dir` |
| 20 |
|
| 21 |
The `--dest-dir` (`-d`) option allows you to override the book's output |
| 22 |
directory, which will be deleted by this command. Relative paths are interpreted |
| 23 |
relative to the current directory. If not specified it will default to the |
| 24 |
value of the `build.build-dir` key in `book.toml`, or to `./book`. |
| 25 |
|
| 26 |
```bash |
| 27 |
mdbook clean --dest-dir=path/to/book |
| 28 |
``` |
| 29 |
|
| 30 |
`path/to/book` could be absolute or relative. |