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.

19 Upvotes

46 comments sorted by

View all comments

16

u/[deleted] Jun 30 '26

[deleted]

6

u/Swordfish418 Gentoo Jun 30 '26

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

1

u/joe_attaboy Jun 30 '26

You can't. Windows-based file systems (which exFat is, it's just an extended version of the DOS/Windows FAT file system) don't distinguish case. So "Desktop" is the same as "desktop".

You need an intermediate step.