June 16, 2011
Well, not *that* interactive

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 -I or --interactive=once option is given, and there are more than three files or the -r, -R, or --recursive are given, then rm prompts the user for whether to proceed with the entire operation. If the response is not affirmative, the entire command is aborted.

11:23am  |   URL: http://tmblr.co/Zn_4by68jQ-r
  
Filed under: rm shell linux 
  1. paksoy posted this