I want to delete the first instance of a duplicated filename...
I use this bash scriptlet to produce a list of files that have duplicate file names
find ./ | sed s#.*/##g | sort | grep mp3 | uniq -d > duplicate_files
The file "duplicate_files" contains the list.
I need to read this file, perform another "find -iname [filename]" and then delete the first record (probably using "head -1") - which should delete the first found instance of a duplicated file.
Help appreciated.
I use this bash scriptlet to produce a list of files that have duplicate file names
find ./ | sed s#.*/##g | sort | grep mp3 | uniq -d > duplicate_files
The file "duplicate_files" contains the list.
I need to read this file, perform another "find -iname [filename]" and then delete the first record (probably using "head -1") - which should delete the first found instance of a duplicated file.
Help appreciated.