comparing two directory structures

2010-09-04 Thread Gabor Szabo
hi, I guess there is an obvious command for this, I just don't know it. How can I compare two directory structures if the content is the same *disregarding* actual file content, or comparing that only if the file names and sizes are the same? As I understand diff -r would do it but it would als

Re: comparing two directory structures

2010-09-04 Thread Omer Zak
If you want to compare filenames, size, ownership and last update time: cd directory1 ls -alR > /tmp/dirlist.1 cd directory2 ls -alR > /tmp/dirlist.2 diff /tmp/dirlist.1 /tmp/dirlist.2 If you want to compare only sizes and filenames: cd directory1 ls -alR | cut -d\ -f 5- > /tmp/di

Re: comparing two directory structures

2010-09-04 Thread Oleg Goldshmidt
Gabor Szabo writes: > hi, > > I guess there is an obvious command for this, I just don't know it. > > How can I compare two directory structures if the content is the same > *disregarding* > actual file content, or comparing that only if the file names and > sizes are the same? > > As I understan

Re: comparing two directory structures

2010-09-04 Thread Kfir Lavi
Hi Gabor, You can use rsync. rsync -avn a b -n is the flag for dry-run. If you add the flag -c then it will compute the checksum for every file. If -c is not used, then it will relay on timestamp and size of file for comparison. output: $ rsync -avn a b sending incremental file list a/ a/file se