[Gllug] Finding files in one directory only / diff question.

Nix nix at esperi.org.uk
Wed Jan 25 01:06:38 UTC 2006


On Tue, 24 Jan 2006, andrew Black moaned:
> Two related questions
> 1.  Is there a way of finding out which files exists in a directory a but not in b. I want to know about some_subdir/only_in_a
>    a/some_subdir/only_in_a
>    a/some_other_subdir/in_both     b/some_other_subdir/in_both
>                                    b/some_subdir/only_in_b
> 
> 
> One way of doing this is to do a find on both directories.

Something involving find and comm would do the trick. I'll think about
it tomorrow.

>                                                            Which leads me to  my second questions
> 2. Is there an option to diff that will allow me to print out lines that exist in first file only (ignoring lines that are in the
> second file only).

You want `comm -2', not diff.

-- 
`Everyone has skeletons in the closet.  The US has the skeletons
 driving living folks into the closet.' --- Rebecca Ore
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list