Maybe something like find ./ -type f | xargs md5sum, then avoid the one directory where the executable has a different checksum. Heck, even find | ls might suffice.
This could be trivially defeated by a program which erases the hard drive unless run using a particular executable name. Then, all twenty entries could simply be hard links to the same executable file on disk, but one of the names would trigger different behavior.
So then you either cat the executable and hope it’s a shell script, you output the binary with a hex viewer and compare, you modify the executable so it’s in a lower permission group and thus wouldn’t have access to erase the drive, there’s like a hundred ways to solve this.
Maybe something like
find ./ -type f | xargs md5sum, then avoid the one directory where the executable has a different checksum. Heck, evenfind | lsmight suffice.This could be trivially defeated by a program which erases the hard drive unless run using a particular executable name. Then, all twenty entries could simply be hard links to the same executable file on disk, but one of the names would trigger different behavior.
So then you either cat the executable and hope it’s a shell script, you output the binary with a hex viewer and compare, you modify the executable so it’s in a lower permission group and thus wouldn’t have access to erase the drive, there’s like a hundred ways to solve this.