Files
MarkdownNotes/howto - Beets Music Library Cleanup.md
2023-12-20 19:13:19 -05:00

17 lines
499 B
Markdown

# Music cleanup one-liners
## Find albums with less than 3 tracks
Useful for finding directories that contain only artwork
```bash
NUM=3 && find /mnt/phnas02/music -maxdepth 2 -mindepth 2 -type f -printf '%h\0' | awk -v num="$NUM" 'BEGIN{RS="\0"} {array[$0]++} END{for (line in array) if (array[line]<num) printf "%s\n", line}'
```
## Beets find and remove albums
Delete album with:
```bash
beet rm -a "Jon Oliva" -d
```
(-a for album and -d to delete the files and not just the database entry)