From owner-freebsd-questions@FreeBSD.ORG Wed Sep 12 00:49:03 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 986D91065674 for ; Wed, 12 Sep 2012 00:49:03 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 577998FC17 for ; Wed, 12 Sep 2012 00:49:03 +0000 (UTC) Received: from r56.edvax.de (port-92-195-63-5.dynamic.qsc.de [92.195.63.5]) by mx01.qsc.de (Postfix) with ESMTP id BE68A3CD81; Wed, 12 Sep 2012 02:48:54 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q8C0msbO004119; Wed, 12 Sep 2012 02:48:54 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 12 Sep 2012 02:48:54 +0200 From: Polytropon To: Gary Kline Message-Id: <20120912024854.1a79d0b3.freebsd@edvax.de> In-Reply-To: <20120912002408.GA10496@ethic.thought.org> References: <20120911213804.GA9817@ethic.thought.org> <20120912011443.5df17cf2.freebsd@edvax.de> <20120912002408.GA10496@ethic.thought.org> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: cksum entire dir?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 00:49:03 -0000 On Tue, 11 Sep 2012 17:24:08 -0700, Gary Kline wrote: > On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: > > On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: > > > > > > I'm trying to checksum directories as I move them around. > > > ive read the man page for sum and cksum ... or maybe skimmed > > > them. no joy. anybody know of a utility to do this? I've > > > got files that are decades old... > > > > Maybe it's possible to tar the directory (without > > compression of course) and obtain a checksum of > > the tar archive? > > > > % tar cf - | cksum > > > > But I also tried cksum directly with a directory > > like > > > > % cksum > > > > and could obtain a checksum - so it _seems_ to work. > > After alteration of one file within the hierarchy a > > different result was printed. > > > > Tested on OS version 8.2-STABLE/i386, one year old. > > > > > I think I tried something like your second example last night. > I think I did > > % cksum foodir/* That lets the shell expand * to the content of foodir, making a final command line like "cksum foodir/file1 foodir/file2" and so on. If you omit the /* part, the directory will be checksummed entirely. If you then remove a file or change it, a different checksum will be printed. At least that is my interpretation of what I've tested. > if there isn't anything that can compare entire dirs, it looks like > it's time to hack a small program. tx, polyt. The Midnight Commander has a function to compare directories which will also identify _which_ files have changed (unlike the command "cksum foodir" that will tell you _that_ a file has been changed) and use the "mark file" function to highlight those files. It can be accessed by putting one directory into the left, the other one into the right panel, and then F9 C C (or Ctrl-X D). You are then presented a selection: +---------------- Compare directories -----------------+ | Select compare method: | | | | [ Quick ] [ Size only ] [ Thorough ] [ Cancel ] | +------------------------------------------------------+ Quick = file names, Size only = file sizes, Thorough = file content. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...