 So today we're going to answer a question that I've been curious about for a long time. And that question is, what happens if you delete the root directory of your Linux system? Now, the question is, why would you ever do this? And the answer to that question is, you shouldn't. You never should. So we're going to start off this entire adventure with stating this warning. Don't do this. Okay. Don't do it by accident. That's not a purpose because, theoretically, we all know exactly what happens if you do the rm-rf slash command. It deletes your root directory and your system goes bye-bye. All your data gone, theoretically, that's exactly what it should do. And that's kind of what I'm expecting to happen. But I don't know for sure. Is there a warning saying, hey, Jackass, don't do this? Is there some kind of process? What happens first? Does the system just automatically turn off? Do you get kicked out to a TTY because it has deleted certain parts of the desktop environment? What happens? I'm really curious. We're going to do it on camera today. But I'm going to reiterate the warning that I just gave you. Don't do this on a production system. I'm not going to do that. I'm going to do it in a virtual machine. We're going to see how it works. The reason why I was curious about this is because everyone in the Linux community has probably seen that troll that always goes through the forms and the discords and all this stuff and says, hey, new person, do this command. It's really cool. It'll help your system go faster. And then it's rm-rf slash. And the new person doesn't know what that means. So they give it a try and then all their data gone. Don't be that troll, obviously, first of all. But also the rest of us should really try to, you know, chastise those people who tell others to do this command. But that's all really beside the point. Let's go ahead and jump into the adventure and see what actually happens. So we're going to be doing this in a virtual machine. And we're going to do it in a boom too. So let me go ahead and get this thing full screen here. This is just a basic version of a boom too. And I'm going to go ahead and see if I can change the display resolution. I should have done this beforehand, but that's better. Okay. So now that we've got that full screen, what happens? So we're going to do this right in a terminal. And you've seen this command before. I've already mentioned it a couple of times, but the command is pseudo. We're going to need pseudo. I'm pretty sure RM dash RF slash. So what happens if we do this? I'm very curious. We're going to find out right now. I'm going to enter and we're going to enter the password. Oh, see, you can't do it. Now I don't know if this is going to be universal on every distro or not. This is for sure what you get on a boom too. I'm actually really happy about this because obviously you don't want this to actually happen by accident. If you do a RM dash RF and then let's just say you're trying to remove the downloads folder. I don't know why you'd use pseudo for this. You shouldn't. I don't think. I can't think of a single reason why you'd want to, but let's just say you did. But let's just say, well, before you got to typing the downloads part, you got here and then you accidentally press enter, you know, that's a good thing that there's a fail safe. Okay. So let's go ahead and see what happens if you override it. So I'm not sure actually where the flag is supposed to go. Probably here dash dash no preserve root. Okay. So here we go. It's removing everything. It's still actually running. So it's removing some stuff before. There goes all the icons and even then there's still stuff there that wouldn't remove. So there's a whole bunch of stuff here that just won't remove and we're actually, we still have an X environment surprisingly. I was really surprised that it kept a lot of X stuff. I'm assuming it's because it's in memory, maybe, but even then it's saying operation not permitted. So even if you have pseudo, I wonder if you were in the root. I wonder. I'm going to try this again. So we're going to go into the root and the commands I'm not found. So there's definitely stuff that's missing. You can't actually go into the root account. Okay. I'm sure there's probably another way of doing that. Let's as a final thing, you notice it deleted the cursors. There's not actually a cursor here. All the icons are gone except for this one, which you can't actually click on. You click on trash and the system crashes. So obviously it breaks. That's the point of what happens, but we still have this black screen and trying to actually, let me get out of full screen here and let's send the machine to sleep. Shut down. Let's see if there's even, it will even let you shut down, which it won't. Okay. Let's go ahead and force this off and let's see if it will boot into it. I doubt it will, but we're going to give it a try. No, nothing. Okay. There's nothing there. So despite the fact that it actually stayed running, despite that fact, which honestly kind of surprises me, I'm assuming that it would actually do something different if you weren't running a pseudo, but we're actually the root user, because there is a difference when you're using pseudo, you're actually just, you're still your own user, but you're using elevated privileges that have been granted to you by the root account. So that's the way pseudo works. I'm assuming that if I actually had logged into the root account first, then did RM-RF, that flag that's needed and then slash, I'm assuming that more stuff would have been deleted and we probably would have lost the X environment. We lost most of it anyways, but I'm still kind of surprised that even doing what we did, that much stuff stayed online, like they stayed up and running. I'm guessing that's because all that stuff just remained in memory, because there's obviously no booting into it now. It's gone, right? So if you're ever in the position where you've done this, which I don't see a way that you could do this accidentally, at least on Ubuntu, I'm not sure if this would hold true on other distros. I'm not going to try it on my endeavor system. I don't want to lose stuff just in case it actually doesn't have a warning, but I'm assuming that that is a kernel level thing and that it's probably across distros, but no matter what, if you're in the position, the reason why I went through and did this with pseudo instead of going into the root account is because that's the way most people would probably experience this scenario. Chances are if you're in the root user, you probably know what you're doing, you're never going to actually do this. But then again, maybe if you're using the root user, you still might do it by accident, I don't know. Maybe you'd be more prone to do it as the root user. So I'm not sure. I guess that's a question for another day. So that is what happens if you are in RF, your system. Surprisingly, it's exactly what we thought it was, your system breaks. So that is it for this video. If you have comments about this whole thing, or if you've ever actually done this to your actual live system, leave that in the comment section below. I'd really like to hear from you. And if you have done it to your live system, tell me if it was a mistake in what you're actually trying to do. Because I'm very curious about that too, because most things that would lead you to the scenario don't actually require pseudo. So even if there wasn't that fail safe in there, usually if you were doing this, you were probably trying to delete something else. And I'm very curious what you're trying to delete that actually necessitated the use of pseudo. So leave those in the comment section below. You can follow me on Twitter at Linuxcast. You can support me on patreon.patreon.com slash linuxcast. Before I go, I'd like to take a moment to thank my current patrons. Today Devon, Patrick Elv, Marcus, Megalyn, Zach and I have tools D-Vay, Seberg, Lennox, Garrick, Mitchell, Arsenaar, Carbondon, Jeremy, Sean, Owen, Martini, Merrick, Cam, Joshua, Lee, Daydog, Peter, A, Crucible, Dark Wind and Six, Vlad, A, and Crimeus. Thanks everybody for watching. I'll see you next time.