Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to write a script to rename various files which I have. This needs commands such as "mv Music music", to try and lowercase my directory names. When I try this I get an error:
mv: cannot move `Music' to a subdirectory of itself, `music/Music'
I'd not come across this before, so I moved to another shell I had open, and tried again in /usr/src, where I had a directory named sisfb. I used the command "mv sisfb Sisfb". There was no problem, nor was there when I named it back. I then changed to the original directory and tried "mv Music music" but again it failed.
I have a feeling that this could be because the music directory is on a FAT32 partitioned harddrive. Has anyone come across this before, and does anyone know how to fix it?
Wow you really analyzed that problem good! Do instead:
rename Music music Music
Life will be easier
(the first and third arguments are the file to rename, and the second argument is the file name to rename to, the third option is used to rename more than one file, its confusing, "man rename")
Right, I tried that, only to get:
jam:/mnt# Bareword "music" not allowed while "strict subs" in use at (eval 1) line 1.
Plus, to be honest, I'm not actually using mv, I'm writing a perl script and using the rename function, but I found I could't get it to work, so I tried mv and got the problem I posted.
I also have got Perl to rename directories before, but no joy here.
I thought of that, but I didn't want to do it because it seemed so unelegant. However, if it is due to the FAT32 not differentiating cases then that's probably the only way.
Thanks, I'll do that.
Hey remember, it is a VFAT32 file system, so it is a bit dumb (like Windoze).
From /usr/src/linux/Documentation/filesystems/vfat.txt
you can put the following options on your mount command for the VFAT32 partition
shortname=lower|win95|winnt|mixed
-- Shortname display/create setting.
lower: convert to lowercase for display,
emulate the Windows 95 rule for create.
win95: emulate the Windows 95 rule for display/create.
winnt: emulate the Windows NT rule for display/create.
mixed: emulate the Windows NT rule for display,
emulate the Windows 95 rule for create.
Default setting is `lower'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.