acd - show added, changed, or deleted files based on signatures
acd [-acdhmusvw] old new
acd reads old and new signature files, which should be the output from "md5sum" or "md5 -r", and prints a list showing which files were added, changed, or deleted.
Actually, any method of hashing a file will do, as long as it prints output in the form "signature \s+ filename". Don't assume the signature is a uniform length; if it contains leading whitespace, print a warning but fix it and continue.
The filename may also contain internal whitespace.
sig.old holds file signatures just after installation. The signatures are just 16-bit CRCs for illustration:
me% cat sig.old
17088 /.cshrc
52314 /.profile
37866 /COPYRIGHT
65498 /bin/[
21849 /bin/cat
64309 /bin/chflags
38258 /bin/chio
26211 /bin/chmod
48631 /bin/cp
49491 /bin/csh
23226 /var/run/dmesg.boot
19047 /var/run/ld.so.hints
33666 /var/run/utmp
37926 /var/yp/Makefile.dist
sig.new holds signatures for a production system that's had lots of files added, deleted, tweaked, etc.
me% cat sig.new
17088 /.cshrc
67890 /.profile
37866 /COPYRIGHT
65498 /bin/[
21849 /bin/cat
64309 /bin/chflags
38258 /bin/chio
26211 /bin/chmod
48631 /bin/cp
49491 /bin/csh
54701 /usr/src/usr.sbin/zic/zdump.8
25531 /usr/src/usr.sbin/zic/zdump.c
24133 /usr/src/usr.sbin/zic/zic.8
64165 /usr/src/usr.sbin/zic/zic.c
We've removed some /var/run files and added some /usr/src files. We've also changed root's .profile:
me% acd sig.old sig.new
A /usr/src/usr.sbin/zic/zdump.8
A /usr/src/usr.sbin/zic/zdump.c
A /usr/src/usr.sbin/zic/zic.8
A /usr/src/usr.sbin/zic/zic.c
C /.profile
D /var/run/dmesg.boot
D /var/run/ld.so.hints
D /var/run/utmp
D /var/yp/Makefile.dist
Just the files on the old system that aren't on the new one:
me% acd -a sig.old sig.new
/usr/src/usr.sbin/zic/zdump.8
/usr/src/usr.sbin/zic/zdump.c
/usr/src/usr.sbin/zic/zic.8
/usr/src/usr.sbin/zic/zic.c
Just the changed files:
me% acd -c sig.old sig.new
/.profile
Just the files on the old system that we've deleted:
me% acd -d sig.old sig.new
/var/run/dmesg.boot
/var/run/ld.so.hints
/var/run/utmp
/var/yp/Makefile.dist
Identical files:
me% acd -s sig.old sig.new
/.cshrc
/COPYRIGHT
/bin/[
/bin/cat
/bin/chflags
/bin/chio
/bin/chmod
/bin/cp
/bin/csh
Added and changed files:
me% acd -ac sig.old sig.new
A /usr/src/usr.sbin/zic/zdump.8
A /usr/src/usr.sbin/zic/zdump.c
A /usr/src/usr.sbin/zic/zic.8
A /usr/src/usr.sbin/zic/zic.c
C /.profile
Everything, including identical files:
me% acd -acds sig.old sig.new
A /usr/src/usr.sbin/zic/zdump.8
A /usr/src/usr.sbin/zic/zdump.c
A /usr/src/usr.sbin/zic/zic.8
A /usr/src/usr.sbin/zic/zic.c
S /.cshrc
C /.profile
S /COPYRIGHT
S /bin/[
S /bin/cat
S /bin/chflags
S /bin/chio
S /bin/chmod
S /bin/cp
S /bin/csh
D /var/run/dmesg.boot
D /var/run/ld.so.hints
D /var/run/utmp
D /var/yp/Makefile.dist
Comments welcome.
Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | 02-May-2019 20:55 | - | ||
acd | 16-Oct-2023 05:23 | 8k | Show added, changed, or deleted files based on signatures | |
acd.1 | 16-Oct-2023 05:26 | 8k | Man page |
Version: 1.2 | 2024-06-26 05:09:34-04 |