4 ms·
Never use rm's -f flag while operating as the root user. Never. Replace with -i until you are absolutely 100% certain the script you're writing works as expecte
by delinka 15y ago
Never use rm's -f flag while operating as the root user. Never. Replace with -i until you are absolutely 100% certain the script you're writing works as expected. Always doubt yourself; be humble.
- nathanb 15y agoThe -I flag is a bit more friendly; one may safely alias rm to rm -I and not even notice on the common case (deleting a single file).
- billswift 15y agoI use a script that moves a file to a ~/.trash directory when I use rm. If I am sure I want to actually delete a file permanently I just use /bin/rm.
- gnoupi 15y agoBut that's also the best way to becoming careless about typing "rm". And the day you will be ssh'd on another computer, you may forget that you are using a command which is really deleting.
- nathanb 15y agoSounds like a great way to fill up your disk to me.
- presto8 15y agoYou could use a cron job that removes the "deleted" files after some period, such as 30 days.