Computing.Net > Forums > Unix > regarding comparing files

regarding comparing files

Reply to Message Icon

Original Message
Name: hoichoi
Date: May 12, 2003 at 19:13:39 Pacific
Subject: regarding comparing files
OS: Unix
CPU/Ram: 256
Comment:

Write a script named finddup which goes through all the files under a directory and prints a list of possible duplicate files. finddup accepts one argument; the name of a directory. As its output, it prints zero or more lines, each one containing a space-separated list of filenames. All the files listed on one line have the same MD5 hash; i.e., are believed to be identical.
A sample invocation of finddup


% finddup /home/bob
/home/bob/tmp/linux-2.4.18.tar.bz2 /home/bob/dl/Linux/linux-2.4.18.tar.bz2
/home/bob/me.jpg /home/bob/public_html/images/bob1.jpg /home/bob/bob1.jpg
/home/bob/mp3/Pixies-Debaser.mp3 /home/bob/mp3/the_pixies/debaser.mp3

This shows three sets of duplicate files: a copy of the Linux kernel sources in two places, what looks like a JPEG image in 3 places, and a MP3 file in two places.


Report Offensive Message For Removal


Response Number 1
Name: David Perry
Date: May 12, 2003 at 19:22:45 Pacific
Subject: regarding comparing files
Reply: (edit)

You would get a better reaction if you started with

"I'm having trouble with my class room assignment. I've read the study material and tried to solve this on my own but I'm having difficult with these part."

No one here is under an obligation to do your homework for you.


Report Offensive Follow Up For Removal

Response Number 2
Name: rmit student
Date: May 24, 2003 at 17:41:52 Pacific
Subject: regarding comparing files
Reply: (edit)

This is so dodgy
Unix System Admin assignment 2 ....
could you have been a little more subtle and not copied out half of the assignment sheet???
I wonder what greg and andrew would say about this....


Report Offensive Follow Up For Removal

Response Number 3
Name: Hayden Oberin
Date: May 26, 2003 at 17:46:11 Pacific
Subject: regarding comparing files
Reply: (edit)


LOL... isn't it funny how people who teach the subject, also use this forum.

its a small world, and in side such a specific topoligy of people (unix admins) you will be hard pressed to get much past us!

Relevant staff are aware of this post, and perhaps i should remind all others reading this group of the following link:
http://www.cs.rmit.edu.au/students/plagiarism.shtml

"Penalties for plagiarism are specified in regulation 6.1, Student Discipline. They are imposed by a disciplinary hearing chaired by a senior staff member. Academic staff are required by the regulation to report all suspected cases of plagiarism to the Head of School, who is responsible for convening the hearing. Lecturers do not have the discretion to discuss cases directly with students."

kase :->



Report Offensive Follow Up For Removal

Response Number 4
Name: Don Gingrich
Date: May 27, 2003 at 04:30:58 Pacific
Subject: regarding comparing files
Reply: (edit)

Very Interesting

-Don
Don Gingrich
Subject Co-ordinator

Unix System Administration
RMIT University


Report Offensive Follow Up For Removal

Response Number 5
Name: bobbob
Date: May 28, 2003 at 00:48:05 Pacific
Subject: regarding comparing files
Reply: (edit)

It's funny,,, i'm working on this problem at the moment... i'll write up my solution as soon as i'm finished....
Hope it will help.

so far i've got... it may not be perfect, but it's a start

#!/bin/sh
file1=`cat *`
find * | md5sum
cd
mv * /dev/null
for i in $file1
do
echo "$file1 is a duplicate"
done


Report Offensive Follow Up For Removal


Response Number 6
Name: bobbob
Date: May 28, 2003 at 00:55:14 Pacific
Subject: regarding comparing files
Reply: (edit)

ps. don't run that script unless you don't particullarly like the contents of your hard drive (more accurately, home directory).


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: regarding comparing files

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software