Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to prevent damage from rm -rf malware' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to prevent damage from rm -rf malware
Authored by: roballen on May 19, '04 04:08:56AM

The company I work for develop software on Redhat, SCO, AIX etc. To prevent accidental deletion of certain key directories we create a file called "-i" or some other such switch. It basically prevents rm -f -f * type commands, as it interpreted as an option to the command.

To remove the actual file, create a blank file "touch testfile", and then "rm testfile -i".

This will not prevent a file or directory from being explicitly removed, however it will stop wildcard deletions, and accidental typos.

Works well for our office.

Rob



[ Reply to This | # ]