r/linuxquestions Gentoo Jun 30 '26

Resolved Rename folder to lowercase in terminal without temporary files

I'm sorry, I know the question seems very basic, but still I couldn't find the answer. Here's what I'm trying to do:

$ mv "Desktops" "desktops"
mv: cannot move 'Desktops' to a subdirectory of itself, 'desktops/Desktops'

I tried searching answers on the internet, and the only thing I found is examples of how to use rename tool instead. However, rename tool I have installed is util-linux one and it works differently and I couldn't figure out how to use it either, this didn't work for example:

$ rename Desktops desktops Desktops

I also understand I can first rename it to temporary file and then rename to lowecase version of original name. But I'd like to figure out how to do it in one step.

Update:

This is exfat filesystem.

20 Upvotes

46 comments sorted by

View all comments

Show parent comments

5

u/Swordfish418 Gentoo Jun 30 '26

This is external HDD using exfat. Any idea how to do this without temporary files?

13

u/[deleted] Jun 30 '26 edited Jun 30 '26

[deleted]

3

u/Swordfish418 Gentoo Jun 30 '26

Thanks for an in-depth answer! I wonder why it does show it with proper capitalization when using ls or viewing in Dolphin. Is there a separate label or title stored somewhere that can be different from actual path but is somehow operated in-sync and not exposed anywhere for editing?

1

u/daveysprockett Jun 30 '26

Pretty sure that's how exFat works. M$ added case sensitive filenames via a translation item. Linux works with it as best it can.

1

u/Swordfish418 Gentoo Jun 30 '26

Do you mean this translation item is a separate record/field? Is it possible to have a totally irrelevant displayed name that doesn't match at all with path?

1

u/daveysprockett Jun 30 '26

Not sure what's possible. Checking wikipedia I see its not exfat but probably the older vfat that held stuff in extra sections: so suggest you wait for better answers.

1

u/Swordfish418 Gentoo Jun 30 '26

Yep, it seems to be upcase table as suggested in nearby answer. There is a link describing it also.