 So I've talked many times on the channel about how important it is to learn the command line And when I talk about that it's not because I'm a command line elitist Or I think that everyone should you do everything in the command line? I really don't think that at all. In fact, I think that the vast majority of people are perfectly fine Doing most things in the GUI. I do think however that there is some Surface-level knowledge that you should have if you're going to use Linux Just to kind of prevent you from doing things that could harm your computer Mainly because there's a reason why the command line is kind of feared because there are some commands that you can run in the command line that could cause serious harm to your computer and What I thought I'd do today is talk about a few of those commands and actually show you what they do now I've already made a video about a couple of these But this is going to be a video where I kind of put them all together So let's go ahead and take a look at some of the commands that you should seriously avoid if you use Linux The first command that I want to talk about is not one that you're ever going to stumble into accidentally This is going to be something that's probably passed to you through some troll on the internet Who's going to say something to you like hey this thing does something really cool You should try it out or perhaps a internet forum or something like that This command again does absolutely nothing other than freeze your system So what it looks like is this for most people this looks like gibberish and it looks like gibberish to me too But basically what it does is it is going to push a whole bunch of processes from the shell into the background So you can actually can't actually see anything and it's just going to increase those processes over and over again Until there's absolutely none left. It's going to be every single amount of resources on your computer now right now I'm in a VM that has four gigabytes of memory and it has four processor cores allocated to it I'm going to go ahead and run this command and you guys should be able to see Htop go crazy now I don't know how long each top will actually continue to run because eventually the background processes run by this command We'll push that out of memory as well So I'm going to go ahead and enter here and really at the beginning it looks like it does nothing but then it's going to do something else and it's going to look like this now and Actually, you can tell see it already has pushed each top out of the way completely each top is no longer running And I can't switch I guess at that point I could switch workspaces But you can tell it's like running really really slow, right and I can't spawn another Oh, it went completely black their time So I'm gonna go ahead and close this and you can see with a little graph here invert manager that this is using all the resources that that VM has every single one of them and you could literally do nothing It completely killed X there But it's still running the background because the shell is still running So if you for some reason get tricked into runions command the easiest way to do everything is just to shut your computer off You're not gonna be able to get into a tty or anything just hit do a hard reset hit the power button and turn it off So that's what I'm gonna do here. I'm gonna do force off and it's gone. So that's the first command Okay, so the second command on this list is going to be one that is it's possible for you to be doing this on your Own you're basically trying to put text in a file from the command line And there are many ways of doing this and the proper way of doing it looks something like this So echo and then hello world If you can spell like so and then to shove runs just like that And then the file that you want to put that in too So in this case basically what this is going to do is take the words hello world and put it into one of these Files so I'm just gonna put it my pie calm calm file And if we now we've even been to pie calm calm hoops actual pie calm calm like so We can actually see here here all the way at the bottom that there is now hello world Just like we'd expect there to be so this is which the proper way of running this command would actually be So let's just say you're doing something that but let's just say you forget something So we have this command here, but let's just say instead of two chevrons. We use just one So if we use just one so we've actually before we do this of them back into pie calm calm And you can see what this looks like. There's a whole bunch of stuff in here And it's running pie calm just like it's supposed to but if we go back up here to That command and then delete one of the chevrons. So you just made a mistake. It's just a typo We hit enter now if we've been into pie calm calm Like so you can see it's completely empty except for the hello world Hello world that we just overwrote it with basically what that one chevron does is completely overwrites the files So all you'd have to do in this case is Make that simple mistake one chevron instead of two and you'd find yourself in a world of hurt because your Configuration file is now completely gone and that would just make you very very sad Right because it could possibly be a file that you can't get back if you don't have a proper backup or if it's a really important file that your whole system relies on if You overwrite it it's gone and that you have a backup of it And it's possible that you overwrite a file that is so important that your computer just shuts down So that is the second command now the third command is going to be one that is almost exactly the same So we're gonna actually do that again. The only difference here is This is going to be a command that you're probably never going to even attempt to do on purpose this is going to be something that again is passed to you probably for malicious Purposes and this is going to be basically formatting your entire hard drive or re overwriting your entire partition and you do this and again You shouldn't do this So if anybody ever passes you a command that looks like this slash dev and in my case, it's going to be slash VDA Like so but for most people it's going to be slash SDA Now basically what that is if you've never seen anything like that before is that's the location of your hard drives partition and if I go back to my home for my actual computer here and Open up a Terminal and do LS BLK LS BLK like so you can see all of the petitions I have on this computer So one of them is SDA SDB SDC and so on and so forth each one of these is a drive Each one of these is a partition on the drive So those are very important things so for example the in my case SDA is going to be all of my Videos and stuff that I've done for the channel in the last few months All that stuff is there if I were to overwrite it all that stuff would be gone So let me show you what this actually looks like let's go back into my virtual machine here And in this case the only drive I have in this virtual machine is slash dev slash VDA if I now hit enter on this Let's see what it does. Oh We're gonna have to do pseudo That's one good thing is that if you do this if somebody passes to you and doesn't give you the pseudo command It won't run so once you run that command you'll see that nothing actually happens I ended up having to enter the actual root user in order to get it to run in the first place, but Actually the whole system continued to run I didn't notice anything was wrong until I tried to reboot the system and in this case I get nothing That's because there's nothing actually there. So Your system will probably continue to run perfectly normally or at least somewhat normally while you're still in that session everything is still in memory I would assume that there are some things that just won't load because it's no longer there if it wasn't in memory already But you won't notice anything seriously wrong until you go to reboot your computer And in which case you'll see something like this where it just won't boot So that's the end of my archcraft install. It's completely gone Okay, so the next one on the list is going to be one that is Something that you may be doing on Purpose this is might be something that you're actually trying to do but not with the drive you're trying to do it so let's just say you're trying to overwrite a Hard drive that you're going to donate to somewhere or you're throwing away or something like that a lot of people will recommend writing that garb that hard drive with garbage data and There are many ways of doing this But one of the ways is with DD now DD is probably the most horrendous command that you're ever going to see on your computer because it's the most Horrifying one because you can literally read write anything with DD. It's called disk destroyer and it will destroy your disc It's used to write ISOs and things like that So it has good purposes obviously, but it's very possible for you to use it in a bad way Or a way that you're not aware of that could cause you some issues and this is one of those ways So in this case, I'm going to do IF which stands for input file and slash Dev slash random and then I'm going to output file and this is going to be where we make our mistakes So chances are you're again only going to ever do this if you're specifically trying to write a Hard drive with a whole bunch of gibberish And you're never going to want to do this on the hard drive that you're actually running your system off from This is probably going to be one that's connected to your computer and you're going to be getting rid of or whatever But in this case, we're going to make that mistake We're going to dev slash VDA and if I hit enter on this again, I'm in the root account So it should work. We're going to hit enter and Then it's going to do some stuff and I'm not sure how long this will actually run or what will happen at the end of it It may continue to run for a while and then everything appears to be fine Just like you did with the last one and then we won't know anything until it comes back But we'll see so as you can see I kind of redid it and added status equal progress so we can actually see that it's doing something and it's doing stuff and it's Not doing anything good So I'm going to let this run and we'll see what the outcome of it of it is at the end This will keep running obviously I should cut in here. It will keep running until it fills up the entire drive in which case I believe I'm pretty sure that this is a 20 gigabyte drive So it's going to take a little bit Okay, that is as done as it's going to get I'm going to reboot this now and see what it does because it should theoretically Not boot into anything. So we're gonna hit Start here again. And yeah, as you see, there's no bootable device there. The entire partition is just gone So again that particular command is Something that you may want to do if you're trying to overwrite a hard drive But in this case you overwrote the whole the wrong hard drive and you're screwed You'd end up having to reinstall Linux and get all of your stuff back. Hopefully via backup So moral of the story here always have a backup. Okay, so we're gonna move on to the last one and This last one is the most famous Command that you should never run. It's definitely one that floats around on the internet saying hey this is cool do this but you should never ever ever do this thing and I'm gonna show you why so the command is pseudo RM dash RF So basically what this is doing is removing a directory recursively and forcibly doing it It's not going to give it any chance and then we're going to do root and then star So this is going to be everything inside the root directory. We're gonna see what this does We're gonna do this. It's gonna ask us for a password and then things are gonna go crazy it's at least theoretically things are gonna go crazy we may end up having to dope. Nope, there we go and Goodbye, everything is gone Everything is gone. It's just I mean you're you do that You're just going to be a sad sad sad little person It's your stuff is never coming back if you if you don't have a backup you're screwed your Linux system is kaput There's no getting it back There's no recovering from running that command at all and there's again no reason why you should run that command on your own the only reason why you would is if you're Like me You're doing it for a video or someone has passed this to you and you know don't know any better So if we were to actually now force this off and then open it up again We're gonna see the exact same thing. We're at before only it's going to get into grub rescue mode And that's because there's absolutely nothing there other than grub So yeah, that is what that command does is again the most famous of all Horrible commands. They're all like all these were really bad for the most part Some of them were because of typos some of them were because of typing in the wrong drive But this one here is the worst of the worst. It has no good reason to be run So that is it for this video if you have comments on these there There were several more that I could have added on to this So maybe I'll do a follow-up video if you're interested in that or something like that Leave those in the comment section below. I'd love to hear from you You can follow me on Twitter at the Linux cast you can follow me on massive And then honestly those links be in the video description You can support me on patreon at patreon.com slash the next cash just like all these fine people Thanks everybody who does support me on patreon YouTube you guys are all Absolutely amazing people. I'm so grateful for your support without you the channel This would not be anywhere close to where it is right now. So thank you so very much for that Thank you guys for watching. I'll see you next time