# How to change a folder name?

**URL:** <https://discourse.beets.io/t/how-to-change-a-folder-name/1954>\
**Category:** Help\
**Created:** [December 13, 2021, 6:25pm UTC](https://discourse.beets.io/t/how-to-change-a-folder-name/1954 "2021-12-13T18:25:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeetBlock](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@BeetBlock](https://discourse.beets.io/u/BeetBlock)\
**Post date:** [December 13, 2021, 6:25pm UTC](https://discourse.beets.io/t/how-to-change-a-folder-name/1954/1 "2021-12-13T18:25:21Z")

</div>

Hello,

I start using Beets and one thing I do not understand. I would like change a name of folder after importation. For exemple I get “Name Album” and I would like change it with “Name Album EP”.

Can you please help? I try Google, search the command line, but nothing yet.

Thanks.

EDIT : I want change this name after an import, not changing the config, it’s different.

EDIT 2 : Looks like I have t use update but really I go no were…

---

<div class="post-metadata">

**Author:** ![snejus](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@snejus](https://discourse.beets.io/u/snejus)\
**Post date:** [December 13, 2021, 10:24pm UTC](https://discourse.beets.io/t/how-to-change-a-folder-name/1954/2 "2021-12-13T22:24:01Z")

</div>

You will probably have to use the `paths`, `item_fields` and `album_fields` config options.

This is the way I currently do it but I doubt it’s the most correct/effective one.

1. Defining custom `paths` templates:

```auto
paths:
  comp: $label_or_albumartist/$catalogue_or_album%aunique{}/${track_identification}_${artist}_${title}
  default: $label_or_albumartist/$catalogue_or_album%aunique{}/${track_identification}
    %if{$multiple_artists,_${artist}}_${title}
  singleton: $label_or_albumartist/%if{$broadcast,${album}/}${artist}_${title}

```

My top level directory is either the `label` or the \_`albumartist` or the \_`artist`. There’s a corresponding `label_or_albumartist` logic definition in `item_fields`:

```auto
item_fields:
  label_or_albumartist: |
    if label:
      return label.lower()
    elif albumartist:
      return f'_{albumartist.lower()}'
    elif albumtype == 'broadcast':
      return f'_{artist.lower()}'
    else:
      return '_lost_'

```

Don’t forget you can use any custom field and (I think) you could also use them here if you need tighter control.

---

<div class="post-metadata">

**Author:** ![BeetBlock](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@BeetBlock](https://discourse.beets.io/u/BeetBlock)\
**Post date:** [December 13, 2021, 10:46pm UTC](https://discourse.beets.io/t/how-to-change-a-folder-name/1954/3 "2021-12-13T22:46:32Z")

</div>

I am sorry, my explanation was wrong I guess.

I do not want a script to change a bunch of folders.  
I do not want change the names of folder when I call import.

I just need to change, sometimes, a few folders in my collection.

If I rename a folder and try to access to this by beet command, it’s won’t work.  
I understand that besause I change a name which he have on BDD.

So just change a name, with one command line, to change the folder and the BDD.

I tried something like (just an exemple) `beet update -a myalbum -m "new folder"`  
And get some error “No matching albums find”.

Thanks.

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [December 14, 2021, 1:20pm UTC](https://discourse.beets.io/t/how-to-change-a-folder-name/1954/4 "2021-12-14T13:20:46Z")

</div>

Here’s the thing: the “philosophy” in beets is that filenames are generated from a set of rules you define, rather than being manually specified. So the thing you might want is to change the `$album` field on your music, which is included in your path formats.

For example, you could try `beet modify -a Name Album album='Name Album EP'` to do what you said in your original post.

@snejus’s suggestion is also good: it’s a more advanced way to define rules to accomplish the general pattern of the filenames you want.

---

<div class="post-metadata">

**Author:** ![BeetBlock](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@BeetBlock](https://discourse.beets.io/u/BeetBlock)\
**Post date:** [December 14, 2021, 3:34pm UTC](https://discourse.beets.io/t/how-to-change-a-folder-name/1954/5 "2021-12-14T15:34:17Z")

</div>

Hmmm, ok, I am not sure I understand everything but let say ok now.

I would like to try your exemple `beet modify -a AlbumName` but I still get an error : `No matching albums found`. I guess, until I will not use this command without error I will struggle for nothing…

What I have to write exactly with AlbumName? For exemple, if I try `beet list pentecost`, I get my album.  
If I use “pentecost” with the update option, error… What I do wrong?

EDIT

```auto
> beet list pentecost                                                                                                  
Anathema - Pentecost III EP - Kingdom                                                                                              
Anathema - Pentecost III EP - Mine Is Yours to Drown In (Ours Is the New Tribe)                                                    
Anathema - Pentecost III EP - We, the Gods                                                                                         
Anathema - Pentecost III EP - Pentecost III                                                                                        
Anathema - Pentecost III EP - Memento Mori / Horses / 666

```

I already change the album name, but just on “space” of Beet (not the folder).

```auto
> beet update -a pentecost -M "1995 Pentecost III EP"                                                                  
error: No matching albums found.

```

EDIT 2 : I forgot, but I tried event with the flag Fields, still the same error.
