There's a lot of operations from the command line that are too easy to screw up. As much as I love having the power available and I'd certainly not give it up, I can't deny that GUIs (or even just TUIs) are much safer since you can visually validate the selection you've made and there's nothing to make a typo on. They also tend to ask for confirmation on destructive actions or provide an undo mechanism. Maybe we need…
How to delete all your files
41–50 of 66 posts
Re: How to delete all your files
#42Re: How to delete all your files
#43I mixed up dd's "of" and "if" args once when trying to image a disk. And of course, it failed somewhere in the middle after borking something important.
dd is one of the most dangerous ones I was thinking of. I hadn't even thought of swapping if and of though, just mistyping the target drive. I would feel so much safer choosing from a list of the drives shown with good identifying info like their manufacturer, size, serial number, and known partitions.
Re: How to delete all your files
#44Earlier quoted context omitted.
> At one point, Linus had implemented device files in /dev, and wanted to dial up the university computer and debug his terminal emulation code again. So he starts his terminal emulator program and tells it to use /dev/hda. That should have been /dev/ttyS1. Oops. Now his master boot record started with "ATDT" and the university modem pool phone number. I think he implemented permission checking the following day. Fro…
You'd think, but a lot of people blindly follow tutorials that Google gives them. As an example, here's my #2 result for, "Linux command line create bootable usb drive from iso": https://www.tecmint.com/create-an-iso-from-a-bootable-usb-in... It instructs you to run this command, despite explaining what "if" and "of" mean in the following paragraph: >sudo dd if=/dev/sdb1 of=/home/tecmint/Documents/Linux_Mint_19_XFCE.…
But I agree about "copy paste instructions". I remember an intern at work asking me how to switch between virtual terminals on Linux, I told her Ctrl-Alt-Fx, I wanted to explain what virtual terminals are and how the shortcuts are probably configurable, but at that point she already stopped listening...
Re: How to delete all your files
#45 $ parted
whoops, all the I erased and recreated were... my root disk!I couldn't figure otu the partition table of the running disk, but I was able to rsync all the data elsewhere and recover it.
IMHO if you invoke parted - WITH NO ARGUMENTS - it should not make a choice for you.
Re: How to delete all your files
#46 rm -rf ~ /foo
I realized after a second or so and hit CONTROL-C. Nothing seemed to have been deleted, so I think it may have been still winding up.Re: How to delete all your files
#47http://web.mit.edu/~simsong/www/ugh.pdf page 28 (68)
>Some Unix victims turn this filename-as-switch bug into a “feature” by keeping a file named “-i” in their directories. Type “rm *” and the shell will expand this to “rm -i filenamelist” which will, presumably, ask for confirmation before deleting each file.
Re: How to delete all your files
#48Another classic is something like "rm -rf /$BUILD_DIR" when the variable is undefined (maybe from a typo or from an argument not passed in).
Re: How to delete all your files
#49I had a close call one time while trying to delete a directory `~/foo` and its contents. Here's what I typed — can you spot the error? rm -rf ~ /foo I realized after a second or so and hit CONTROL-C. Nothing seemed to have been deleted, so I think it may have been still winding up.
Re: How to delete all your files
#50I had a close call one time while trying to delete a directory `~/foo` and its contents. Here's what I typed — can you spot the error? rm -rf ~ /foo I realized after a second or so and hit CONTROL-C. Nothing seemed to have been deleted, so I think it may have been still winding up.
rm is not like explorer.exe and is rather fast with destruction, so I guess you must have deleted some dotfiles.
Whatever it got I never noticed. Maybe it was trawling through a bunch of build detritus in `~/.cpan` or something.