4 ms·
Bash tip I picked up from observation - always start a potential command with # # rm -rf some_dir Then if you accidentally press return before completing it
by robaato 6y ago
Bash tip I picked up from observation - always start a potential command with #
# rm -rf some_dir
Then if you accidentally press return before completing it hasn't happened.
When you have reviewed and are sure it is correct, you recall and delete the hash to execute - simples!
- matart 6y agoDoes this work with autocomplete?
- greenyoda 6y agoJust tried it with bash on Linux, and apparently autocomplete works in a comment.
- arendtio 6y agoIn my opinion, the option -r should only be allowed as the last parameter. Maybe with the exception of -f. Everything else is just f*ing dangerous. I mean, I use the # hack sometimes too, but when I don't, I find myself often being afraid of accidentally coming on the enter key.
- stjohnswarts 6y agoI generally throw up a status report type of thing "you are applying $this_operation to $this_many_machines on $this_farm. Continue (yes/no)?" and enforce yes/no full typing. Anything other than yes is a no