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: Emmanuel <email@hidden>
- Date: Sat, 17 May 2003 09:52:37 +0200
At 9:11 PM -0700 16/05/03, 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.
Now you've got the lines sorted, you can handle duplicate lines with Smile's Regular expressions. You will find stuff about duplicate lines in the script examples in Smile Reference Manual. Links to Smile Reference Manual at:
<
http://www.satimage-software.com/en/softx.html#smile>
Emmanuel
_______________________________________________
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.