Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-14-2013, 02:58 AM   #1
Registered: Jan 2004
Distribution: Ubuntu 9.10, 10.04
Posts: 39

Rep: Reputation: 15
Multiple directories with exactly the same name in the same directory!

I'm trying to make mirror thumbnails of the files on mac to linux box. But sometimes i get two folders with the same name on my linux box.
To try to make this as easy to follow as possible i'll reproduce my steps below

1.) Rsync directories to mirror directory structure.
(sudo rsync -a --ignore-existing --include='*/' --exclude='*' /Volumes /var/www/img)
2.) Generate thumbnails with imagemagick
3.) Use gnus tar to compress the thumbs and directory structure
(tar -cf)
4.) Unpack the .tar on my linux box

I have tried fsck to merge the duplicate directories without result. At the moment i have no idea on how to proceed.
Does anyone have any idea?

Last edited by pandersson61; 02-14-2013 at 03:28 AM.
Old 02-14-2013, 08:08 PM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,986

Rep: Reputation: 1444Reputation: 1444Reputation: 1444Reputation: 1444Reputation: 1444Reputation: 1444Reputation: 1444Reputation: 1444Reputation: 1444Reputation: 1444
Sounds to me like you're dealing with a case-sensitive vs. a case-insensitive file system. The default filesystem used by the Mac is case-insensitive, to match the original Macintosh conventions, although Macs (such as mine ...) do have a case-sensitive filesystem available. When setting up my MacBook, I reformatted the drives to use that ... tho' it might be a little too late to do the right thing now.
Old 05-15-2013, 09:40 AM   #3
Registered: Jan 2004
Distribution: Ubuntu 9.10, 10.04
Posts: 39

Original Poster
Rep: Reputation: 15
Well the thing is that the mac filesystems are case-insensitive, but the mirrored file system is ext4. So it should not matter on the linux box.
I have attached a tar.gz that contains two directories with the same name. If you unpack it (under linux) you'll get two directories with exactly the same name. But under mac you'll get just one directory.
Strange stuff!
Does anyone have any idea?
Hopefully i will be able to solve this by merging the two directories together.

Checkout the file here, its just 14k.

Old 05-16-2013, 03:10 AM   #4
Registered: Jan 2004
Distribution: Ubuntu 9.10, 10.04
Posts: 39

Original Poster
Rep: Reputation: 15
I found the issue, in case someone else encounters the problem ill explain it in short below.

It turns out that OS X uses "utf-8 nfd" and Linux uses "utf-8 nfc". So the character encoding is different (even though it doesn't show in linux).
So you have to convert the nfd filenames to nfc filenames. And you have to do that under Linux, Mac doesn't support using nfc.
There is a handy program to do that and its called "convmv". The command i used to convert all filenames in one folder is:

convmv -f utf8 -t utf8 --nfc --replace --nosmart --notest -r folder-name

Hope this helps someone...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Folders to a Single Path yermandu Linux - Server 4 04-14-2010 05:18 PM
error with multiple shared folders snake_eyes Linux - Software 0 03-10-2009 05:30 PM
copying multiple files in multiple folders ?? stratotak Linux - Newbie 2 02-21-2009 10:41 AM
Rename multiple files in folders??? adds2one Linux - Software 19 10-05-2006 01:22 AM
Copying files from multiple folders into one aardwolf64 Linux - General 4 01-03-2006 12:53 AM

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration