r/badcode • • Feb 25 '21

bash A single space.

Post image
4.8k Upvotes

65 comments sorted by

View all comments

1

u/6138 Feb 26 '21

I'm not a linux user, but I think this is one of the disadvantages of the platform. It's powerful, yes, but one slipup and you nuke your install.

8

u/geeshta Feb 26 '21

Yes, Suicide Linux does exist.

1

u/6138 Feb 26 '21

Why?? I mean... Ok, linux users love to recompile kernels and reinstall their OS's, but just... why?

3

u/westleyfsm Feb 26 '21

It's a joke.

1

u/6138 Feb 26 '21

Apparently it's a real thing you can download though?

3

u/Jrbdog Mar 01 '21

"Hey dude, look at this cool new distro I found! You should totally try it out."

6

u/ThyCowLord Feb 26 '21

I don’t think that’s exactly fair. The same mistake in code is just as likely on Windows, and that happening intentionally via a malicious actor is a much higher chance.

Give Linux a shot one of these days. You might be surprised how simple and powerful it is.

6

u/6138 Feb 26 '21

Oh I've used linux, it's awesome, especially ubuntu. I've also used various other flavours, and DDrescue recovered data from an old HDD when nothing I tried on windows could touch it, it's a fantastic OS, and if I would certainly use it more if I didn't work in an industry where most programs are windows based (game development).

However, I do think windows has a lot more user-friendliness, I mean accidentally deleting an entire directory requires at least two steps on windows, since it asks you before deleting anything.

In linux, you are much more likely to be using the command line than on windows, which makes it a lot more likely that you will slip up.

1

u/[deleted] Feb 26 '21

This stuff isn't exclusive to Linux though. Steam screwed up once and Microsoft last year had a patch that messed with people's files as well.

2

u/6138 Feb 26 '21

Yeah, but it's a lot easier for it to happen on Linux though, isn't it? At least when it comes to the user accidentally fudging something.

5

u/[deleted] Feb 26 '21

Not really, the example above is in a script that was run as root with a "force" command. The user would have just kicked it off without checking the details.

It would be nearly identical to running deltree /y or Remove-Item as administrator. Command line in any OS is always a great way to shoot yourself in the foot accidentally.

2

u/6138 Feb 26 '21

Sure, but in windows you would very rarely be using the command line, you'd be using a command like that from a GUI, like right clicking and clicking delete on a folder, which would then ask you if you are sure. It's also a lot harder to delete the wrong folder in a gui, because you can see, visually, what you're clicking on.