Re:Some Useful Bash Aliases – Chuck Carroll
by metal on Monday December 25, 2023 @02:31PM
(#38765386)
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.
[ Parent
| on HN ]
Re:Some Useful Bash Aliases – Chuck Carroll
by Galanwe on Monday December 25, 2023 @04:15PM
(#38766189)
That 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