comparing two directory structures

comparing two directory structures

Kfir Lavi lavi.kfir at gmail.com
Sat Sep 4 21:12:11 IDT 2010


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

sent 74 bytes  received 19 bytes  186.00 bytes/sec
total size is 23.29K  speedup is 250.47 (DRY RUN)

Investigate the -q option if you want to use this command from a script.

Regards,
Kfir

On Sat, Sep 4, 2010 at 12:21 PM, Gabor Szabo <szabgab at gmail.com> wrote:

> 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 also compare files
> line by line.
>
> As these are images and movies, I don't want to compare them line by
> line or event byte by byte.
> As a first approximation I only want to list files that exists in one
> directory but not in the other
> or when the files have different size.
>
> Gabor
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20100904/8dbc9ed6/attachment.html>


More information about the Linux-il mailing list