I will pass on a secret that I learned several years ago to help prevent the dreaded accidental rm * (though it would not have helped with the /* portion of */*)
Create a file in your home directory named --oops. Under bash this seems to work:
$ touch -- --oops
The glob in rm * sees the file as an argument, and an illegal one at that, and refuses to go on.
no subject
Date: 2007-03-08 08:13 pm (UTC)Create a file in your home directory named --oops. Under bash this seems to work:
$ touch -- --oops
The glob in rm * sees the file as an argument, and an illegal one at that, and refuses to go on.
$ rm -f * rm: illegal option -- - usage: rm [-f | -i] [-dPRrvW] file ... unlink fileIt at least helps with the rm -f * .txt type accident.