Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Comparing directory contents

3 views
Skip to first unread message

mchaudhu77

unread,
Dec 14, 2006, 9:21:07 AM12/14/06
to
Is there some way in Linux of comparing two directories on two
different servers, and seeing the differences between them?

For example, I want to compare and report differences between the
contents of the bin directory on production and on development Linux
servers.

Thanks
Mitali

boyd

unread,
Dec 14, 2006, 11:44:18 AM12/14/06
to
In article <1166106067....@80g2000cwy.googlegroups.com>,
"mchaudhu77" <mcha...@gmail.com> wrote:

If the files are supposed to be identical, then rsync in the
"non-action" mode will report what it would do to bring the 2 hosts into
synchronization. As in: (untested)

rsync -n -v -a host1:/usr/local/bin/ host2:/usr/local/bin

The inclusion of the "/" on the path ends is critical - see the rsync
man page for examples.

Boyd

Andrew Smallshaw

unread,
Dec 14, 2006, 4:04:30 PM12/14/06
to

If all you want to do is check for the presence or absence of each
file (you aren't concerned with checking that each file is identical,
just that they're present) then on the devel machine:

$ ls bin >development.ls

and on the production machine:

$ ls bin >production.ls

Get both files in the same place and run diff on them. If OTOH,
you only need to be alerted of programs on the development machine
that aren't on the production server then use:

$ comm -23 development.ls production.ls

--
Andrew Smallshaw
and...@sdf.lonestar.org

mchaudhu77

unread,
Dec 14, 2006, 4:08:26 PM12/14/06
to
Thanks for all your answers.

0 new messages