cksum entire dir??

Mike Jeays mike.jeays at rogers.com
Wed Sep 12 18:31:19 UTC 2012


On Wed, 12 Sep 2012 10:55:57 -0700
Waitman Gobble <gobble.wa at gmail.com> wrote:

> On Wed, Sep 12, 2012 at 10:46 AM, Gary Kline <kline at thought.org> wrote:
> 
> > On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote:
> > > On 12/09/2012 00:14, Polytropon wrote:
> > > >     % cksum <directory>
> > > >
> > > > and could obtain a checksum - so it _seems_ to work.
> > > > After alteration of one file within the hierarchy a
> > > > different result was printed.
> > >
> > > That will give you a checksum on the directory inode -- file names and
> > > associated metadata only, not file content.  In theory you could edit a
> > > file without modifying any of the timestamps, and that wouldn't result
> > > in any change to the directory checksum.  Also, modifying things a few
> > > layers down the filesystem hierarchy won't have any effect either.
> > >
> > > Generally I find the best test for differences between old and new
> > > copies of a filesystem is 'rsync -avx -n ...'
> > >
> > > Also, sum and cksum have way too small a key size for this to be
> > > reliable, since you can't tell a true result from a hash collision.  Use
> > > md5 or sha1 or sha256 for best results.
> > >
> >
> >         So this sha256 is *real*??  I have no md5 on my "fedora"
> >         that is on my desktop and m having trouble getting used to.
> >         but the gentleman who recommened cpio was right on the money.
> >
> 
> 
> 
> are you sure it's not 'md5sum' ? ... that seems to be on all my GNU/Linux
> machines.
> 
> Waitman Gobble
> San Jose California USA
> 
> 
> 
> 
> >
> >         note that I am loathe to spam this list with the following mail
> > from my
> >         files in sept, 1988, but here it is.  if I had only gr -r -w cpio
> >         around in all my directories, I would have found this, sent to one
> > Dirm
> >         Myers across the pond ::
> >
> >
> >         ===
> >
> > >From kline Sat Sep  5 11:52:20 1998
> > Subject: lost mail file...
> > To: dirkm at buster.dhis.eu.org (Dirk Myers)
> > Date: Sat, 5 Sep 1998 11:52:20 -0700 (PDT)
> > Organization: <> thought.org: public access uNix in service... <>
> > X-Mailer: ELM [version 2.4ME+ PL32 (25)]
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=US-ASCII
> > Content-Transfer-Encoding: 7bit
> > Content-Length: 2283
> > Status: RO
> >
> >
> >   Yesterday morning I began composing the next two Q's and A's
> >   in my mailer.  Last night in the wee hours there was a power
> >   glitch and I lost the mail.
> >
> >   Enclosed is the first//next Q/A.  I'll send along another one
> >   or two later today.  One that I was playing around with *failed*
> >   and I'm trying to figure out why.
> >
> >   -----
> >
> >   How can I uise my FBSD floppy drive to copy files to it (in this case,
> >   at work), and retrieve the files on my FBSD systtem at home.  So far
> >   I've only seen examples that used floppies with a filesystem on them.
> >   Is there a simplr, more direct way?
> >
> >   You can treat the 'raw' floppy device as if it is a tape drive, and
> >   use typically UNIX tape tools to read/write, such as tar and  cpio.
> >   For instance, to copy the current directory onto a floppy to
> >   take home at night:
> >
> >         (put the floppy in the drive, and cd to the directory where
> >          the files are; then )
> >
> >         % tar -cvf /dev/rfd0 .
> >
> >   To read it when you get home:
> >
> >         (put the floppy in the drive at home; and extract the tarball
> >          wherever you want the files)
> >
> >         % tar -xvf /dev/rfd0
> >
> >   The flags -c and -x indicate create and extract mode, the ``v''
> >   specifies verbose mode, and the ``f'' tells tar that the following
> >   argument is the file or device that tar acts upon.  Here, it is
> >   the floppy devide.
> >
> >
> >   With cpio:
> >
> >         (chdir to the directory where the files are)
> >
> >         % ls | cpio -oc > /dev/rfd0
> >
> >        To read a cpio archive from a tape drive:
> >
> >        % cpio -icd < /dev/rfd0
> >
> >
> >        The flags -i and -o indicate copy-in or extract mode and
> >        copy-out or create archive mode.   The ``c'' tells cpio
> >        to use the old, portablr ASCII archive format.  And the
> >        ``d'' flag tells cpio to create directories where necessary.
> >
> >        Do a
> >
> >        % man cpio
> >
> >        for much greater detail on this utility.
> >
> >   -----
> >
> >   There are another one or two of the simpler Q/A's and one or two
> >   more involved.
> >
> >   Then, for this month only, I want to write a paragraph or two
> >   about who I am and where I'm coming from.  Since you are sharing
> >   the by-line you might want to consider this too.
> >
> >   gary
> >
> >   PS:   Next month we get a break!!
> >
> > --
> >    Gary D. Kline         kline at tao.thought.org          Public service
> > uNix
> >
> >         ====
> >         as you can see, this dealt with my olden tape drive.  a 250meg
> >         QIC drive, I think.    but this was about the earliest reference
> >         I could find re my use of cpio.  there are others in my journal
> >         dir that reference my running out of hard drive and using cpio
> > rather
> >         that a straight cp -rp.  [this was back when a 130meg drive was
> > Huge
> >         and made me feel rick.]
> >
> >
> >
> > >       Cheers,
> > >
> > >       Matthew
> > >
> > > --
> > > Dr Matthew J Seaman MA, D.Phil.
> > > PGP: http://www.infracaninophile.co.uk/pgpkey
> > >
> > >
> >
> >
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "
> > freebsd-questions-unsubscribe at freebsd.org"
> >
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

My Linux system has both md5sum and md5deep. They give the same result, except that md5sum quotes the file name in the current directory, and md5deep gives the fully-qualified name. I have been using md5deep - I didn't know md5sum existed.


More information about the freebsd-questions mailing list