Live data from Hacker News

How to delete all your files

reddit.com

41–50 of 66 posts

Re: How to delete all your files

#41
post #22

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…

Microsoft Windows actually provided a transactional file system called Transactional NTFS (TxF)in Windows Vista. However, due to the complexity and lack of widespread use, it has since been deprecated.

Re: How to delete all your files

#43
post #26
post #21

I 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.

There’s a reason they call it “disk destroyer”.

Re: How to delete all your files

#44

Earlier 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.…

Actually that command seems accurate, because the instructions is to do the reverse of what you googled - it's telling people "how to make an image from a disk device", but in this case the image file has the ".iso" file extension.

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
I was once doing a lot of stuff to a disk with gnu parted. I popped out and popped back in like this:

  $ 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
I 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

#47
Unix Haters Handbook is still surprisingly up to date.

http://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

#49
post #46

I 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.

Re: How to delete all your files

#50
post #46

I 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.

Could be. This was on a Mac, around 2013, so it should have been pretty snappy.

Whatever it got I never noticed. Maybe it was trawling through a bunch of build detritus in `~/.cpan` or something.

Post reply on HN