Jump to content

Linux vs Windows File Names


Robert

Recommended Posts

Recently I backed up some files on my Ubuntu computer to an external Western Digital My Passport drive. It is an NTFS drive so can be read on my Windows 10 computer, but if I try to copy files over there are problems.

 

For instance, Linux sees Rob.jpg and rob.jpg as two different file names and two different files. Windows sees them as the same file name no matter what the capitalization.

 

When I hook up the external drive to the Windows computer it can see the two different files, but won't let me copy them to the Windows computer unless I change one of the file names. Backing up to a Windows computer is not an easy task when multiple files of the same name are involved. Sometimes there were half a dozen or more at a time, and even though I was trying to be careful, sometimes Skip was selected instead of the harder to properly do rename, so the backup was incomplete.

 

I guess the good news is an NTFS formated hard drive has no problem with the file names.

 

Sometimes when I hook up an external drive to the Windows computer I get a message that there is a problem with the drive and asks to fix it. I does not happen every time. I'm wondering if that is Windows detecting files with the same name and if allowing it to fix the "problem" is messing up my files made in Linux, thus messing up my external backups.

Link to comment
Share on other sites

That's odd, I always thought 'R' and 'r', for example, were two completely different characters. I'm no expert on the intricacies of it, but they're different on the ASCII table. Maybe it's different for UTF-8.

Link to comment
Share on other sites

securitybreach

Well here are two ways to do that:

 

CLI method - First, 'cd' into the directory with your files you want to change. Then, run this:

 

ls | while read upName; do loName=`echo "${upName}" | tr '[:upper:]' '[:lower:]'`; mv "$upName" "$loName"; done

 

Graphical method - Install Thunar and use the bulk rename function which should be under the Accessories shortcut on the left panel.

Link to comment
Share on other sites

securitybreach

That's odd, I always thought 'R' and 'r', for example, were two completely different characters. I'm no expert on the intricacies of it, but they're different on the ASCII table. Maybe it's different for UTF-8.

 

Well Windows is a bit funny about naming schemes.

Link to comment
Share on other sites

Well here are two ways to do that:

 

CLI method - First, 'cd' into the directory with your files you want to change. Then, run this:

 

ls | while read upName; do loName=`echo "${upName}" | tr '[:upper:]' '[:lower:]'`; mv "$upName" "$loName"; done

 

 

 

If I understand correctly, that command deletes the lower capital letter file, then saves the upper capital letter file with the same name in lower caps. So rob.jpg is deleted and replaced by Rob.jpg, which in turn is renamed rob.jpg. Correct?

Edited by Robert
Link to comment
Share on other sites

securitybreach

Sort of...if it sees an uppercase name(read upName), then it runs loName which is the following command:

 

${upName}" | tr '[:upper:]' '[:lower:]'`; mv "$upName" "$loName

 

If that completes, it is done.

 

Now I would try to copy a couple of examples to a folder and run it from there to test how it handles the names of ones that already exist as lowercase. I think it adds a 1 to the filename but I am not for sure so better to test it. Does that make sense?

Link to comment
Share on other sites

Sometimes when I hook up an external drive to the Windows computer I get a message that there is a problem with the drive and asks to fix it. I does not happen every time. I'm wondering if that is Windows detecting files with the same name and if allowing it to fix the "problem" is messing up my files made in Linux, thus messing up my external backups.

I often get that message using an NTFS USB key in Windows that also is used a lot in Linux, particularly for transferring large multitrack recording sessions from Windows to Linux. I never let it "fix the problem" as it doesn't tell you exactly what the "problem" or the "fix" is. So far no issues.

One of the reasons I rarely use Windows. I'm sure Clippy is still hiding in the background somewhere! :)

  • Like 2
Link to comment
Share on other sites

Sometimes when I hook up an external drive to the Windows computer I get a message that there is a problem with the drive and asks to fix it. I does not happen every time.

Only time I personally had this happen was when I had formatted a USB stick in linux and went to use it to copy files from a win7 machine. I let windows "fix" the issue, because I had no data to lose at that point, and didn't get the message after that.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...