On 2017-03-17 00:56, David Haller wrote:
Hello,
On Fri, 17 Mar 2017, Bernhard Voelker wrote:
On 03/16/2017 10:31 PM, Greg Freemyer wrote:
Be especially sure not to create to files "-rf" and "/"
I've never tried it, but I assume "rm *" in that folder could do "rm -rf /"
Not too scary - GNU rm has a failsafe for the '/' argument (including links and unusual ".." namings to it):
$ rm -rf / rm: it is dangerous to operate recursively on '/' rm: use --no-preserve-root to override this failsafe
... as long as you don't create a file named "--no-preserve-root". ;-)
Ooooch mennooo! That takes out all the fun!
Hasn't it been the lore, that if you've not once accidentally run 'rm -rf /' or at least 'rm -rf ~', you're no UNIX/Linux guy?
Or at least: you deleted some files via a tyop, and learned from it. Either by coping with the loss (you had backups, din'tya?) or the hard way using debugfs.
That one, yes. Swallowed the loss, yes. Using rsync, with --delete. The second run I pointed at the wrong source, so it destroyed the backup. And the original had disappeared I don't remember why. So I lost both the original and the backup in the operation.
Well, I hope that after many years, that I've learned to enter a Ctrl-c unless I'm _REALLY_ sure (triple-, quadruple-checked) the commandline I've just entered.. 'dd if=/dev/zero of=/dev/sdNOSUCHDEV' anyone? where NOSUCHDEV actually is something like 'c' or such ;)
Enter a ctrl-c? in the command line? How? Yes, I'm paranoid when using dd. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))