Live data from Hacker News

Ooops.

github.com

101–110 of 247 posts

Re: Ooops.

#101
post #79

Is there a good reason why Linux doesn't have a recycle bin?

Even if it did, you wouldn't use it in this case. Windows batch files delete files outright too, instead of sending them to the recycling bin. You don't want to have to depend on the user to clean up after your automation.

Re: Ooops.

#102
Looks like someone never read the Unix Hater's Handbook. Another fun thing is rm + shell expansion. A file named * or / can cause extremely unintended deletions.

Re: Ooops.

#103
post #80

Earlier quoted context omitted.

dead tired, 4am in the morning working on a client app for a huge client of theirs (I was subcontracting) was trying to remove everything inside a folder and instead of going rm -rf ./* I went rm -rf . (can't get the wildcard thingamajig to show up) It took me a second to understand why the command was taking so long to run, by the time I figured it out and killed the command, I had wiped out almost half of what was…

Wouldn't that just delete the folder instead of emptying it?

Back in the day, rm followed .. if you specified it on the command line. It went like this:

You are in .; The current directory listing include ..; Recursively deleting everything deletes everything on the drive.

Actually, I think the one time I saw someone do this, wildcards were involved. And I was going to explain, but the comment system is making my asterisks into bold markers.

Re: Ooops.

#104
post #90

Earlier quoted context omitted.

Almost all of the desktop environments commonly used with Linux do have a trash bin.

If it wasn't obvious, "Why is `rm -rf` not connected to the recycle bin?" is implicit in my original question.

You're operating at a layer below where a trash can makes sense. Pretend that this command had moved everything to a trash can. The command to move the files out of the trash can now resides in the trash can, where it isn't being very useful. It's still possible to recover the files, but then again, it's also still possible to recover the files you deleted with rm.

rm is on the same layer as the DOS del command. Neither goes to the trash can, because they operate on a lower level.

Re: Ooops.

#105
post #20

just tried to explain this to a few of my windows using coworkers.

"Tried?" Certainly it wasn't that hard to explain.

no, they got it. they just didn't get why its funny. I guess you have to fuck up rm -rf at least once to get these sort of jokes.

it's like explaining jeep jokes to non-jeep owners.

Re: Ooops.

#106
I'd like to make a request to all the posters on Hacker News, and the people that upvote them.

  STOP POSTING SHIT FROM REDDIT AND 4CHAN.
  THERE'S ENOUGH RETARDED MEME BULLSHIT ALL OVER THE INTERNET.
  WE DON'T NEED IT HERE.
Thank you.

Re: Ooops.

#107
post #60

Never use rm's -f flag while operating as the root user. Never. Replace with -i until you are absolutely 100% certain the script you're writing works as expected. Always doubt yourself; be humble.

The -I flag is a bit more friendly; one may safely alias rm to rm -I and not even notice on the common case (deleting a single file).

Re: Ooops.

#108
post #101
post #79

Is there a good reason why Linux doesn't have a recycle bin?

Even if it did, you wouldn't use it in this case. Windows batch files delete files outright too, instead of sending them to the recycling bin. You don't want to have to depend on the user to clean up after your automation.

You don't want to have to depend on the user to clean up after your automation.

I don't see what's the big deal is. Once in a while when the recycling bin gets too big, the user can empty it. Or you can have a scheduled operation that deletes stuff after 30 days.

Re: Ooops.

#109
post #89

Earlier quoted context omitted.

because real Operating systems don't need one?

That's what I thought. I'd be happy if anyone chimed in with a legitimate reason, but I won't be surprised if the lack of a recycling bin is just one more symptom of the Linux developer community's apathy towards the actual human beings who use their software.

I would speculate that it is a historical reason. It's no secret that the Unix environment was not designed for personal use in homes, but on mainframe time shared computers inside universities and businesses. Space was limited, and just moving files to another location to deal with later added unnecessary steps to a process that didn't have much of a benefit, at the time.

As space has become less valuable on computers, and they have become less of a specialized tool, it may be wise to add one, but most of the desktop environments already implement it already so there is no need to recreate the functionality at a lower level.

Re: Ooops.

#110
post #36

rm is like a knife where the handle has a sharp edge too...

A double edge knife/sword?

more like a double-edge bladed boomerang that'll come back to bite you in the ass if you throw it just the right way.
Post reply on HN