I always alias rm to rm -i to prevent fat-fingered mishaps. This is usually too chatty if you try to recursively delete even a moderately big directory, so you have to go all out with rm -rf.
I get chills every time I type that little f in there and it turns out the new version of rm from GNU coreutils allows an alternate interactive mode -I that will prompt you once for all arguments. It also skips prompting altogether if you specify less than 4 files for deletion.
From the man page for rm:
If the
-Ior--interactive=onceoption is given, and there are more than three files or the-r,-R, or--recursiveare given, thenrmprompts the user for whether to proceed with the entire operation. If the response is not affirmative, the entire command is aborted.
-
paksoy posted this