From owner-freebsd-questions@FreeBSD.ORG Wed Sep 12 15:14:32 2012 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 E0712106566B for ; Wed, 12 Sep 2012 15:14:32 +0000 (UTC) (envelope-from gobble.wa@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6778C8FC08 for ; Wed, 12 Sep 2012 15:14:31 +0000 (UTC) Received: by weyx56 with SMTP id x56so1243451wey.13 for ; Wed, 12 Sep 2012 08:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QCM0Xd3scRiVM4yFd7UPe7Dg/PwDFh8vATAhil5m/oQ=; b=NI1lte55N0PGY6/V/v/pJk+c6RUBb63YkpjIjUruWOywkE3DDUpMwASiWI62fVvszV BmuvFb/5HrRWUVSiWxIQyW5OnmT/aAmKrfhduezFZ7ZZ7txV33aXreuC+JJVEg7KiMMI sS6nMj5jyKOLdr7g2wObBZc9G69FZtUiS0PPiPmlC/4XoiO9/Vs1mDy9lmprX1qJ3YZ0 QuRr+6XbgVE/ekESi830VzKKfBN4fU6k6WsitbrZP+zDBFCAvMlJ698++EB3UZq1HiHr tauNxPhimsoGKdnUakIpyWrIcZVDjf5WO1KxxhWUK9uJ7tbAcOqKzrfFFMJU19DxknG4 YFpA== MIME-Version: 1.0 Received: by 10.216.233.95 with SMTP id o73mr12928865weq.59.1347462871057; Wed, 12 Sep 2012 08:14:31 -0700 (PDT) Received: by 10.216.183.2 with HTTP; Wed, 12 Sep 2012 08:14:30 -0700 (PDT) Received: by 10.216.183.2 with HTTP; Wed, 12 Sep 2012 08:14:30 -0700 (PDT) In-Reply-To: <20120912050658.GA11860@ethic.thought.org> References: <20120911213804.GA9817@ethic.thought.org> <20120912011443.5df17cf2.freebsd@edvax.de> <20120912002408.GA10496@ethic.thought.org> <20120912011813.GA2305@neutralgood.org> <20120912050658.GA11860@ethic.thought.org> Date: Wed, 12 Sep 2012 08:14:30 -0700 Message-ID: From: Waitman Gobble To: Gary Kline Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Mailing List , kpneal@pobox.com Subject: Re: cksum entire dir?? 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: Wed, 12 Sep 2012 15:14:33 -0000 On Sep 11, 2012 10:10 PM, "Gary Kline" wrote: > > On Tue, Sep 11, 2012 at 09:18:13PM -0400, kpneal@pobox.com wrote: > > On Tue, Sep 11, 2012 at 05:24:08PM -0700, Gary Kline wrote: > > > On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: > > > > 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. > > > > > I think I tried something like your second example last night. > > > I think I did > > > > > > % cksum foodir/* > > > > > > and had to compare each file from another file I was copying from= . > > > it was tiresome to check each of dozens of files tho. I was here at > > > desk for something obscene -- over 12 hrs. getting my new [slightly > > > used:)] computer back to normal. > > > > > > if there isn't anything that can compare entire dirs, it looks like > > > it's time to hack a small program. tx, polyt. > > > > Unix was originally created to do text manipulation. No need for a new > > program when you can do it from the command line. > > > > cd dir1 ; cksum * | sort > /tmp/dir1-cksum > > cd dir2 ; cksum * | sort > /tmp/dir2-cksum > > > > diff /tmp/dir?-cksum > > > > Don't forget to remove temporary files when you are done. > > > > Other useful commands: > > cut > > paste > > > > You can use awk to pull out and rearrange columns: > > cksum * | awk '{ print $3, $1, $2; }' | sort > > > > This gives you a little easier diff in case you do have changes. > > > > Friendly tip: if you did comparisons by hand for 12 hours then you > > may have missed something. > > > no, it was several other tasks that I had t o do very carefully > by hand. I was going to write an awk script. I figured there > were others ways. > > my desktop is a flavor of linux that i don't know. it seems to be > lacking in many common unix binaries; md5 is one that I spent > an hour checking. zero. > > your first way works very well and will serve. many thanks. > now I can listen to: > > /Lectures on the Critique of Pure Reason > > which is now safely in my home directory in several mp3 files. > > > > > It's a real shame Unix doesn't have a really good tool for comparing > > two directory trees. You can use 'diff -r' (even on binaries), but that > > fails if you have devices, named pipes, or named sockets in the > > filesystem. And diff or cksum don't tell you if symlinks are different. > > Plus you may care about file ownership, and that's where the stat > > command comes in handy. > > > right. these are things you only discover the hard way. > > > > Not that I'm volunteering, mind you. I ended up instead writing a > > Python script to do copies of filesystems off of old machines I'm > > putting to pasture. It's amazing how badly old versions of dump and > > tar behave. > > > REmember CP/M and MP/M? I started out with a dual 8085/80888 box > with MP/Mand wrote notes and letters that were stored on 8" > twin floppies. circa mid-1980's I transferred a boatload of floppies > onto my 386 with SVR2 with uucp and others C programs on the 8088 box. > it took forever and things keep faulting, but I got it done. > eventually. > > > oh yeah, I remember the Kaypro =ABportable=BB which was as big as a sampson= ite, and despite being built like a tank probably couldn't handle a wrangling by a gorilla. Waitman Gobble San Jose California -- > > Kevin P. Neal http://www.pobox.com/~kpn/ > > > > "I like being on The Daily Show." - Kermit the Frog, Feb 13 2001 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " freebsd-questions-unsubscribe@freebsd.org"