Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare two folder

Status
Not open for further replies.

unixisbest

Technical User
Jul 11, 2005
28
0
0
Hi all,
I need your solutions to compare two folders. I have two folders which has same directory and file structure. But i need to check that if both of them have equal files or not. And if there are any diferencies between two same files need to log it into a file.

My idea is using diff command like for example,

diff /usr/disk1/folder1/progs/PROG1 /usr/disk2/folder2/progs/PROG1


But the problem is there are thousends of files with diferent locations like this. So first i need to put files file paths into a file and then use diff command file by file. Therefore it is not gonna be easy.

Do you know any tool that can make this? Or any script idea?

Thanks guys
 
The GNU diff may recursively compare 2 directory structures.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If you are on a Sco machine, there's "dircmp".

Hope it helps.

Theophilos.

-----------

There are only 10 kinds of people: Those who understand binary and those who don't.
 
Sorry that i forgot to tell about Unix machine i have. I use HP-UX.
 
Actually dircmp is just a shell script that creates lists of the files contained in the two directories and compares them. The problem is that I don't know if it is copyrighted (so I can post it here).

Theophilos.

-----------

There are only 10 kinds of people: Those who understand binary and those who don't.
 
Hi theo,
Thanks for advice. HP-UX also has dircmp and it seems work well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top