Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
November 25, 2024, 03:54:14 PM
News
: LinuxSolved.com Linux Help Community Forum..
Home
Search
Login
Register
Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
»
Network Troublshooting
»
Linux Servers Support
»
compare/diff two directory in two different linux/unix machine
« previous
next »
Print
Pages: [
1
]
Author
Topic: compare/diff two directory in two different linux/unix machine (Read 17898 times)
chuikingman
Linux Noob !
Posts: 6
compare/diff two directory in two different linux/unix machine
«
on:
September 22, 2009, 04:25:31 AM »
Hi,
I have two server , one linux and one unix .
I want to compare two different directry in them .
What command or tool I can use instead of search the dir one by one
thank
Logged
pedro
Linux Noob !
Posts: 14
Re: compare/diff two directory in two different linux/unix machine
«
Reply #1 on:
September 28, 2009, 09:19:17 AM »
Have you checked rsync? Example:
$ rsync -avz --list-only /my/local/directory/ remore-server:/the/path/to/remote/dir/
This should list the files that are different in the local directory that would be copied to the remote if you'd run the rsync command without the --list-only option.
HTH.
Logged
neko
New Member
Posts: 1
Re: compare/diff two directory in two different linux/unix machine
«
Reply #2 on:
October 19, 2009, 08:37:12 AM »
I used the following command on Open SUSE to list files in the current directory that are different or do not reside on a remote server directory. This comparison does not look at the time stamps on the files and also skips files that are the same size.
rsync -nvr --size-only ./ freddy@remotehost:/home/freddy/bin
The -n option is used to perform a test or (dryrun) to show what would have been transfered.
The -v option is used so that it displays some feedback
The -r option is used to recurse in subfolders
Logged
dragoncity99
LST CareTaker
Experienced
Posts: 551
Re: compare/diff two directory in two different linux/unix machine
«
Reply #3 on:
October 29, 2009, 03:26:27 PM »
If you dont want to do any file changes. But to do investigation.
I suggest you do this:
1. Do "ls -lR /directory > Linux_Directory.txt" on linux. Do the same on Unix.
2. Do a diff -y on both server.
Alternatively. You can use find command to drill down and dump to a file as well to do the diff.
Logged
Print
Pages: [
1
]
« previous
next »
Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
»
Network Troublshooting
»
Linux Servers Support
»
compare/diff two directory in two different linux/unix machine