Re:How do I prevent accidental rm -rf /*?
by barrkel on Saturday December 03, 2011 @07:57PM
(#3309451)
If I'm going to be doing something major to a lot of files, I often write a script that outputs the commands to execute, so I can verify what's going to be done. Then I reexecute and pipe to bash.
It's not quite applicable to something used as off-handedly as rm, though it could be done. Something like:
It's not quite applicable to something used as off-handedly as rm, though it could be done. Something like:
might produce output like: And so on. That can then be piped to bash as a confirmation.