Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 May 2009 21:19:56 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Polytropon <freebsd@edvax.de>
Cc:        =?UTF-8?B?WWF2dXogTWHFn2xhaw==?= <yavuz.maslak@netiletisim.net>, freebsd-questions@freebsd.org
Subject:   Re: How can I extract differences between 2 folders ?
Message-ID:  <4A009F6C.80009@infracaninophile.co.uk>
In-Reply-To: <20090505215611.c074b710.freebsd@edvax.de>
References:  <D140D3378E824AC1995B6A6503732D69@desktop2002>	<20090505165621inode@frozen-zone.org>	<4D71445373A74C088A3CDBF3868278A4@desktop2002> <20090505215611.c074b710.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Polytropon wrote:
> On Tue, 5 May 2009 21:35:22 +0300, Yavuz Maşlak <yavuz.maslak@netiletisim.net> wrote:

>> I wish diff or another command not to display same values which are in 
>> different lines.
> 
> You could first run the files through sort, then diff them.

Rather than diff(1), perhaps comm(1) is a better choice.  You still need to
sort the input files though:

   % sort file1 > file1.sorted
   % sort file2 > file2.sorted
   % comm -3 file1.sorted file2.sorted

This will print two columns of output.  The first column consists of lines
that are only in file1, and the second of lines that are only in file2.

	Cheers,

	Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkoAn3IACgkQ8Mjk52CukIwUnACeITunf8MdVUhK0Sdl/sKRYdAq
gjMAn27ZV40HW9WTB3ak2KOB2cNQBzse
=VwX8
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A009F6C.80009>