by doctor_eval · 4y ago · 0 comments
# find /tmp -exec rm {} /;
But instead she’d typed # find / tmp -exec rm {} /;
I learned a lot about Unix (and, as it happens, X windows) file systems that week. Note that this was long before tools like sudo existed, where cleaning up tmp was often a manual process.There is no way we could blame a person for a single keystroke error - it’s crazy that the command worked - but I now look at the find command with an enormous amount of fear.
rm -rf ${basedir}/*
without setting set -u
to exit if there are undefined variables. I suggested a few other sanity checks but was told I was adding friction.