Re: Finding Duplicate named files with exactly the same size
Re: Finding Duplicate named files with exactly the same size
- Subject: Re: Finding Duplicate named files with exactly the same size
- From: Christopher Nebel <email@hidden>
- Date: Sat, 17 May 2003 10:33:44 -0700
On Friday, May 16, 2003, at 09:11 PM, Jon Pugh wrote:
At 11:10 AM -0500 5/16/03, Mielke, Gary R. (CGC) wrote:
I am looking for some help on a OSX finder script to find duplicate
file names on my hard drive. I would also like a log file created
that shows the file name and path to the duplicate files. I am trying
to clean up multiple backups to a hard drive.
I wouldn't use the Finder. It doesn't help you in this quest.
The unix geek in me thinks you could do something like this:
do shell script "ls -R / | sort > /filelist"
This does a file listing (ls) recursively start at your hard disk's
root directory (that's /), and pipes (the | separator) that list to
the sort command and then the sorted list gets written to a file named
filelist (via the > separator). There's your log file. Duplicates
will be right next to each other. Perhaps someone knows a way to suck
the duplicates out of the file. I don't know how with just the shell
commands.
do shell script "ls -R / | sort | uniq -d > /filelist"
Of course, this doesn't satisfy the original request, which was to have
both the filename *and* the path to it.
--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.