LinuxQuestions.org
Review your favorite Linux distribution.
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 06-08-2010, 04:04 AM   #1
b-RAM
Member
 
Registered: Apr 2009
Distribution: OpenSuse, Slackware
Posts: 70

Rep: Reputation: 15
find duplicate files using bash script?


Hi all, what kind of method to find the duplicates files on linux,
1.how to find just using the file name, sometimes i figure out people often to copy their files to another directory and i want to find out if there any same file name in the linux box.
2. what about if i want to find the duplicate files based on contents of the file, example is in picture file if users store picture files from digital camera first they just save the file name in default but when they want to give that picture to others they will rename it, i've been used method md5 for this situation in python script but it takes long time
to finish this thing, is there any other way?, btw i'm asking this question just to know to use bash script a lot in work and i want to test out fdupes at home, is fdupes use similar md5 scan to find duplicate files?

Thank's a lot and sorry if my question disturbing your time.
 
Old 06-08-2010, 04:22 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

You can have a look at this example using script, this one using fdupes or this one using fslint.

All of this I found using Google in 0.31 seconds. It took more time to type this message

Kind regards,

Eric
 
Old 06-08-2010, 05:14 AM   #3
b-RAM
Member
 
Registered: Apr 2009
Distribution: OpenSuse, Slackware
Posts: 70

Original Poster
Rep: Reputation: 15
Thank's a lot for your help EricTRA, and sorry about my question ^^.


Best Regards.
 
Old 06-08-2010, 05:43 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

You're welcome and no need to apologize. Just pointing out the obvious

Kind regards,

Eric
 
Old 06-08-2010, 07:05 AM   #5
Gridley
LQ Newbie
 
Registered: Apr 2010
Posts: 10

Rep: Reputation: 1
Just my $0.02

Be careful what you consider to be a duplicate file. For example the fdupes script referenced above relies upon md5sum. Now, I realize it's highly improbable, BUT, there is no reason that two different files can't end up with the same md5sum.

And another thing - remember that Linux relies upon links (both hard and soft) so be sure to check whether the file being reported as duplicate is not actually merely a link.

Last edited by Gridley; 06-08-2010 at 07:12 AM.
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to find the duplicate files Tekken Linux - Server 6 03-30-2013 11:29 AM
how to find files using bash script prernasin Linux - Newbie 6 09-26-2007 08:57 AM
A bash script to find duplicate image files fotoguy Programming 7 01-25-2007 06:47 PM
Script to find duplicate files within one or more directories peter88 Linux - General 6 12-10-2006 05:17 AM
Trying to find the files that contain distro information for my bash script ethics Linux - General 5 07-04-2006 04:48 AM


All times are GMT -5. The time now is 03:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration