LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-29-2011, 09:07 AM   #1
heimbichner
LQ Newbie
 
Registered: Dec 2011
Posts: 1

Rep: Reputation: Disabled
File Mgmt. Removing duplicate files.


I apologize in advance if this is posted elsewhere in the forums. I have a mess of music on my external that I would like to clean up. I'm wondering if there is any programs or commands out there that will allow me to search a directory, and all sub-directories, for duplicate files. Further, is there a way to show files that are duplicates but have case changes in the name (i.e. song, Song)? I've been digging through the internets but just can't seem to find what I'm looking for. Also, is there any way you can tell if a file is a duplicate even if it has a different name without having to open it? I'm running Mint 12, 64-bit. Thank you!
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-29-2011, 11:29 AM   #2
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Quote:
sudo apt-get install fdupes
To list duplicates:

Quote:
fdupes -r /path/to/desired/directory/ > duplicates.txt
To delete duplicates automatically:

Quote:
yes 1 | fdupes -rd /path/to/desired/directory/
 
2 members found this post helpful.
Old 12-29-2011, 02:00 PM   #3
Ajay Kumar
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Rep: Reputation: 0
You can use the find command to search a file recursively in a directory. Here is an example that I use many times to find files.

#find <path> -type f -iname <filename>

May be you can also write a script and process the output from find to achieve how you want to manage the duplicacy of files.
 
Old 12-29-2011, 10:11 PM   #4
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Quote:
Originally Posted by Ajay Kumar View Post
#find <path> -type f -iname <filename>
This solution does not satisfy OP's request to not be dependent on filenames:

Quote:
is there any way you can tell if a file is a duplicate even if it has a different name without having to open it?
fdupes compares files by sizes and MD5 signatures, followed by a byte-by-byte comparison - so filenames can be completely different.
 
  


Reply



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
does tar or bzip2 squash duplicate or near-duplicate files? garydale Linux - Software 6 11-19-2009 04:43 PM
removing duplicate entries shabev Linux - Enterprise 3 03-25-2008 10:36 AM
Identify Duplicate Files by File Name rickh Programming 8 06-21-2006 03:04 PM
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
Speedtouch mgmt.o file : where to get it! psychoholic Linux - Networking 3 03-20-2003 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:51 AM.

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