LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-08-2007, 12:28 PM   #16
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282

Don't know about your tr and xargs, but you have created one long filename by the looks of it.
It looks like you have a mistake in your second tr (compared to one posted earlier)
Code:
tr ' ' '\000' |
versus
Code:
tr '' '\000' |
But I'm not sure about this part.
 
Old 07-08-2007, 03:11 PM   #17
alexander_bosakov
Member
 
Registered: Mar 2006
Location: Plovdiv, Bulgaria
Distribution: OpenSuse 11.3
Posts: 55

Rep: Reputation: 15
Well, some suggestion what's happening: It's not linux that creates the duplicate entries, it is Windows. It's because of the FAT directory entry structure - it's intended to store DOS's 8.3 file names, so when Windows introduced the long names, they used additional directory entry records. If you look at such a directory under pure DOS, you'll see more than one name for a single file, e.g. "FILEBL~1.HTM", "..B L A B L.A B", ... or something like, for the file that Windows sees as FILEBLABLABLA.HTML. So, I suppose you mounted your network drive as type "fat", which treats such a filesystem the way DOS does, instead of mounting it as "vfat", which is the windows's way.
 
Old 07-08-2007, 05:11 PM   #18
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The stat commands you showed indicate the the files have different inodes.
That means that they are duplicate files and not just duplicate entries.

Don't worry about the lower case entries being a different color. I think
that indicates that they are associated with an application to display them.
I see the same thing.

You could check if they are truely unique by using the md5sum command to calculate their
hash values. Only identical files will contain the same hash values.

Code:
find /home/photographs/ -type f -iname "*.jpg" -exec md5sum '{}' \; | sort | uniq -w32 -D >duplicate_list
The list will contain a list of the original files and their duplicates.
Examine the list and see if you have pairs of .jpg and .JPG with the same md5sum values.
If the list is OK, you could remove the .jpg entries leaving only the .JPG entries to delete:
Code:
# lets preview this once first.  If an environmental locale setting is wrong, 
#sed might select both lower and upper case in some cases.
sed '/\.jpg$/d' duplicate_list
# if you see only .JPG files displayed then it is safe to proceed
sed '/\.jpg$/d' duplicate_list | tr '\n' '\000' | xargs -0 -L100 rm -v
P.S. could you edit one of your previous posts so that the width of this thread isn't 400 characters!

Last edited by jschiwal; 07-08-2007 at 06:23 PM.
 
  


Reply

Tags
duplicate, filename



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which module creates device files baloon Red Hat 8 03-29-2007 03:00 PM
LXer: Piracy creates jobs, FOSS creates opportunities LXer Syndicated Linux News 0 11-02-2006 11:33 AM
Why when editing files does Linux create a duplicate file with a ~ in the extension? bugbite99 Linux - General 6 01-17-2005 02:21 PM
Duplicate Files and linux carl0ski Linux - Software 1 12-22-2004 04:45 PM
Linux creates buggy folders/files on fat32 chily Linux - General 4 03-14-2004 09:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:34 PM.

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