Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have two servers with "similar" OS loads on them. One server is production the other is test. I wish to compare the differences in the directory structure/file systems for the two.
Can anyone help w/ a simple 'diff' type command for server A and server B? An added note, these servers, unfortunately are on different networks and cannot talk to one-another.
I am a bit of a newb to the land of Linux so I apologize for the potential simplicity of this thread.
I'm sure there's a few ways to do this but here's how I'd go about it.
Let's say you want to compare the /usr filesystems (if you want the whole system, replace /usr with /) on hosts a and b .
On a: # find /usr | sort > filesystem.out.a
On b: # find /usr | sort > filesystem.out.b
Then get the filesystem.out.X files onto one machine, and run:
# diff filesystem.out.a filesystem.out.b
If the output is a bit big, try 'diff -d'. You should get a smaller output, but it may take a bit longer.
As already replied by Dave, diff would work for you. Since you are using linux, better use "locate" command to get the listing, it would be amazingly fast.
Here is what you need to do:-
1. On both servers (I assume its Linux), run "updatedb". This will build an internal slocate database for "locate" command.
2. Run the command and grep for the filesystem you wish to compare:-
locate etc > filenameA
3. Afterwards just do the diff as suggested earlier.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.