LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   File Mgmt. Removing duplicate files. (https://www.linuxquestions.org/questions/linux-general-1/file-mgmt-removing-duplicate-files-921064/)

heimbichner 12-29-2011 09:07 AM

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!

klearview 12-29-2011 11:29 AM

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/

Ajay Kumar 12-29-2011 02:00 PM

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.

klearview 12-29-2011 10:11 PM

Quote:

Originally Posted by Ajay Kumar (Post 4561191)
#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.


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