From owner-freebsd-questions@FreeBSD.ORG Tue Mar 23 07:41:08 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 263F9106566C for ; Tue, 23 Mar 2010 07:41:08 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id 98E698FC08 for ; Tue, 23 Mar 2010 07:41:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id o2N7f5B3020493; Tue, 23 Mar 2010 18:41:05 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Tue, 23 Mar 2010 18:41:05 +1100 (EST) From: Ian Smith To: "Aryeh M. Friedman" In-Reply-To: <20100322120021.C2A26106571B@hub.freebsd.org> Message-ID: <20100323181056.I85436@sola.nimnet.asn.au> References: <20100322120021.C2A26106571B@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org Subject: Re: how to compare permissions between two dirs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2010 07:41:08 -0000 In freebsd-questions Digest, Vol 303, Issue 2, Message: 11 On Mon, 22 Mar 2010 07:33:28 -0400 "Aryeh M. Friedman" > In switching to a new make file for a personal project I have run into > the problem of under the old makefile everything works (web site) and > under the new one it does not... when manually looking at the two dirs > they appear identical in layout, sizes and perms (dir and file level) > but I want to make sure... is there any way to compare two diff dirs and > see if they only differ in date stamps? (note since there are several > developers working on this project I need to compare even if the owners > are diff) % diff dir1 dir2 should do what you need, to compare file existence and contents. % ls -lrt bittorrent bittorrent2 bittorrent2: total 82 -rw-r----- 1 smithi smithi 81110 Nov 22 2004 bittorrentecon.pdf -rw-r----- 1 smithi smithi 0 Jun 9 2006 not_in_1 -rw-r----- 1 smithi smithi 49 Jun 9 2006 differingfile bittorrent: total 82 -rw-r----- 1 smithi smithi 81110 Nov 22 2004 bittorrentecon.pdf -rw-r----- 1 smithi smithi 0 Jun 9 2006 not_in_2 -rw-r----- 1 smithi smithi 28 Jun 9 2006 differingfile % diff bittorrent bittorrent2 diff bittorrent/differingfile bittorrent2/differingfile 1,2c1,3 < this one in bittorrent dir < --- > this one in bittorrent2 dir > with an extra line > Only in bittorrent2: not_in_1 Only in bittorrent: not_in_2 Then to just compare (eg) permissions and names, something like: ls -la dir1 | awk '{print $1,$9}' >/tmp/lsd1 ls -la dir2 | awk '{print $1,$9}' >/tmp/lsd2 diff /tmp/lsd1 /tmp/lsd2 cheers, Ian