6 ms·
Do this in important directories for added safety: $ touch -- - i This creates a file called "-i" which will add the interactive flag, prompting you before del
by metal 3y ago
Do this in important directories for added safety:
$ touch -- - i
This creates a file called "-i" which will add the interactive flag, prompting you before deleting every file that rm was going to delete.
- Galanwe 3y agoThat seems flaky at best. Basically you rely on "*" expansion to inject the -i. While that may work for `rm -rf *`, it won't for `rm -rf foo/*`, `rm -rf foo`, etc
- metal 3y agoThat's the point. You're not relying on it, it's a safety to save yourself from an unintended glob expansion.
- Groxx 3y agoOr for far better reliability, just use safety and add that to the config.