Check File Integrity with a sha256sum Hash List
Record a hash list with find -exec sha256sum {} + and check it with sha256sum -c --quiet. It reports changed and missing files but never a new file.
You want to know whether anything in a directory changed since a known good moment, without installing an integrity tool.
mkdir site && echo a > site/a.txt && echo b > site/b.txt
find site -type f -exec sha256sum {} + | sort -k2 > manifest
echo "changed" >> site/a.txt
rm site/b.txt
echo new > site/c.txt
sha256sum -c --quiet manifest; echo "status: $?"site/a.txt: FAILED
sha256sum: site/b.txt: No such file or directory
site/b.txt: FAILED open or read
sha256sum: WARNING: 1 listed file could not be read
sha256sum: WARNING: 1 computed checksum did NOT match
status: 1The manifest holds one hash and path per line, and sha256sum -c recomputes each. With --quiet only the problems are printed: the changed file says FAILED and the removed one says that it could not be opened. The exit status is 1 in both cases. The sorting by path keeps the manifest stable between runs, so it can be compared as text. Options are documented in the coreutils manual.
The check never mentions c.txt, because it only reads the files the manifest names. To catch additions, generate a new manifest and compare it with diff. The manifest must be kept somewhere an attacker cannot write, or it can be regenerated along with the change. A package manager's own check, such as debsums or rpm -V, covers installed files without this.