11 More Linux Commands Every Linux User Needs | Learning Terminal Part 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm going over part two of learning terminal in it I go over 11 essential commands you need to know to get around terminal easily so before I jump into these 11 commands I just want to preface this video just to say this is a skim of these commands I'm not doing deep dives into each command because I don't really like spending 30 minutes to 45 minutes doing deep dives and explaining every single option in a command I would like you to refer back to part one where I say man and then the command and also the command - - help these kind of expand out so you can learn more about these commands I'm just showing basic usage just to let you know these commands exist this is how many people get around terminal quickly and efficiently so with that said let's jump into the actual commands ok so now let's get into the actual learning need more advanced commands that just kind of help you get around and console a little bit better here these commands are very very vital I use them daily if not every hour almost so let's go ahead and jump in here and do history for our first command so if you just type history into your terminal you can't see everything I've done lately you can kind of see hey I was uploading a file to my website I was doing all these other things and let's say I wanted to execute one of these commands let's say I want to do hey my bash shell I'm gonna change some things in my batch cell so if you the next command I'm going to teach after history is how to execute history so one thing that's really awesome here is if you hit the exclamation mark and then type let's say in a in if you look up to line 134 here you see it says Nano - our EC and you don't actually have to do history before this you can just type the exclamation mark and then ser is a lot of ones I use a lot where I'm rebooting services or system control or these types of things that's what you use this for so you don't have to type all that out so as you see it went ahead and executed that nano command from history so that's pretty awesome and that's very very powerful another thing you can do is actually execute certain line numbers at history so let's say you wanted to do 134 you see how that works - so you can do that as well and that's pretty nice if you have this up and you just go hey I don't even want to type the very beginning numbers it's easier to type this so you can kind of see all the different things I've done as far as like hey I was doing some fire our rules here and I could Evi pull that in as well so that's just those two commands history and then exclamation mark last command and I'm gonna put this in the description down below just so you know so the next up is an echo command so if you type echo blah you see how it echoes blah well that doesn't really do much for you however when it comes to system variables let's say you forgot what your wine prefix is you could use that or let's see what the wine architecture is it's currently not set or you could do echo shell see what the shell is our mantra using bash so it's been bash if it's z h z Sh it would be been z SH you can do echo editor let's see what editor I'm using I don't have that one set but I could set like Nano instead of them or whatever as a default there's all these other system and tools or basically that echo command can actually call those system environment and if you're unsure of something you can actually just type that in here we using the echo command and see what that variable is so very very powerful tool okay let's talk about system control or systemctl real fast systemctl is basically a service that controls what runs when your system starts up so you have many options after systemctl you have enabled to enable the service status to check the status of it start and stop - you know and then also enable and and this enable and disable mainly just says hey I want this to always start when I start my computer or I want to disable it so it doesn't start and that's the main commands you need to know and I'll have this in the description as well and you can also look it up through the manual by typing man systemctl but for today let's just check starting off what services are currently on the system not necessarily enabled so we do this by just a system CTL lists unit files this pulls up a nice long list with a whole bunch of stuff anything that says static or disabled just leave alone enabled and disabled are the ones that you can toggle back and forth back and forth so these are really really good things to know but when you're looking at this it's just there's just so much stuff that comes with it that's not necessarily running so I need to teach you the next command or the grep command as its called and well we need to kind of cool this down so to do this let's do this but we do the pipe symbol that's above the inner key again and then we do grep and then say enabled and what this does is it says hey I know you're about to spit out up a whole bunch of stuff but I only want to grap or a grip the enabled stuff and then as you see it really cools that down so now we got a really good list of what is being done on this system so that grep command is super powerful you can use it with any command in it is just a lifesaver especially when you just get a wallet text like we just saw so that's systemctl and grep just in a quick breeze through again if you guys need a deeper dive in these certain commands I highly recommend doing man systemctl I talked about this in the last video but it kind of gives you a really good synopsis of what everything looks like when to use it and gives you a good readout so if you really want a further understanding and not just the quick overview that I'm doing today this is a good way to get that so with that done we can move on to our next command which will be disk free well disk free is pretty darn awesome and something I do every single day anytime I wonder how much the hard disk base I have DF kind of spits out what we have here now sometimes it spits out a bunch of garbage here puts it in bytes and things you can't read you can do DF space - H just think of human human readable DF space - H gives you that nice human readable touch so from here you'll be able to see that the drive usage and see hey and the home directory right now I'm using almost all of my 230 gig solid state so that's something I should keep in the back of my head that I need a little watch out for everything else is looking good I'm not even touching how much I need to do on any of them so I'm good there as far as storage is concerned but again that's just DF and then - H I almost always use the deaf/hh command with it either one usually sometimes gives some garbage and stuff so just remember EF - H with that done I wanted to go and touch on SSH and SSH is basically learning or basically running remote commands or remote terminal on another box this is extremely vital in business I use it every day my entire website I can't even remember the last time I didn't SSH into it to do all those things so - SSH locally though most most devices don't run on what's called keys I'm not going to get in that today just because it could be a very very long-winded subject if you're going outside into the world and trying to SSH in a box almost always you're going to need what's called a certification key or SSH key that is generated with encryption these I'm not going over today just because that is again a very long tutorial but let's say you have a Raspberry Pi that I wanted to SSH into so I happen to have one that I use for a variety of different things so let's SSH into my raspberry pi PI is the standard user and then I put the @ symbol so SSH space the username at and then whatever address it resides on you can also use host names here as well I always use IP addresses just because I'm a nerd like that and they'll say hey we have an SSH den to this before can you verify the fingerprint I always just say yes and then it will say hey type in the password and then from here we can kind of see hey what's going on with this retropie actually that set it up as retropie of course and then you can kind of see all the other stuff I have I got Cody and some other there that I just use kind of as a test box for my Raspberry Pi but to get out of the Raspberry Pi you can run all your terminal commands here and you're like okay I'm done with this box I need to get out you just simply exit and this closes the connection and now we're back into our system notice how the user name before the prompt actually changed to the Raspberry Pi which its host name was retro PI and then it when I hit exit it moved this back over into our system and that's SSH I'm not going to go too much into that I could probably spend a good 20 minutes on SSH alone I just wanted to show this just so you don't have to think that you need to download some other program like in Windows you're using putty or some other program you're downloading on the web and it's all built baked into the nice terminal in Linux and it is just completely awesome okay so the next command I wanted to show you is one just basic checking what IP address you have so if you're in Ubuntu it's an ifconfig and this would actually pull in your your actual IP addresses this uses I believe the IP tools deal however if you're in an RPM based distro like fedora and CentOS or if you're in a Manjaro or arch based it's just IP space 8a or a DDR it doesn't matter we'll just do a for short this kind of shows you hey I have two network cards ello is just a loopback which is just default so just go ahead and leave that alone but you can also see what other is so you can actually check what your actual IP address is right here it's the 192 one nine one six eight 69.95 ocol IP but let's say I actually wanted to check what my external IP is now there's a long command you can actually high up to Google every time it's a Digg command and to memorize it takes a lot of work however there's a cheap way of doing it and getting your external IP and that's just to curl it so if we do a curl ifconfig dot me it'll say oops I have config dot me it'll say hey that was 70 6.85 dot you know I'm not gonna have said all that because saying my external IP to you guys is probably not a good idea but you get that you get the gist of it if you just do that simple curl command you'll go ahead and be able to see your external IP right there and be able to do all the stuff that you want to do which is awesome so that is the IP addr or I have config depending on the district on to check your IP address and then also just curling your external IP to just curl ifconfig dot me that was the easiest one for me to personally remember there are other ones you could get that from but that's the one I like to use have been using for many years on my personal computers and that is that in a nutshell as far as anything you need to know about learning your IP address the next couple things I kind of wanted to show for an advanced thing is one just seeing what processes are running by default top is installed in every distribution and if you type you can kind of see what your CPU usage is and then kind of browse around and see what processes you're using now obviously since I'm and very high font here I can't really see much just my top running processes so I'm gonna go ahead and quit out of this just by doing a queue now I do recommend something called H top H top is a lot more powerful and it allows scroll ability so you see it kind of condenses all the CPU and I can kind of just guide around with my arrow keys and let's say I find a process that I don't want I could easily just say hey I'm tired of broadcasting using OBS and just hit you know f9 and kill that process and then when I'm done I can hit f10 to quit but there's a lot of things that you can use this for an H top is just mandatory in my opinion as I do a lot of stuff and when you get stuck in terminal H top is just a lifesaver so this is how you do it obviously you wouldn't use H top that much in a desktop environment you would do like a ctrl escape and just pull up your regular command to kill processes in the GUI using graph user interface but in terminal H top is king I hope you like this video these eleven commands I use almost on a daily basis I love doing them and honestly my research into this video was me just hitting history and looking at the glass couple you know 50 commands I've typed in I'm like alright cool I'm gonna make a video about those commands because that's obviously what I'm using the most so that's how I came up with these commands in this video one thing I noticed when I rewatched my how-to here was that I missed the grip command a little bit I wanted to expand on that piping and gripping in pretty much a lot of commands one thing I should have mentioned was when you do a cat in the file name you can also do the pipe symbol and then the grip command and then any specific search text you want and it'll just spit out that line on like a text file which is really powerful as well and then also curling or the curl command you need to install curl to use that for ifconfig but curl is pretty much needed and a ton of application so I highly recommend installing that package to use curl ifconfig dot me I love curl but a lot of system security specialists do not like curl because a lot of times people are running full scripts using curl and then like an external address and it will pull all that in so with all that said guys that's it for today's video and I'll see you in the next one [Music]
Info
Channel: Chris Titus Tech
Views: 32,825
Rating: undefined out of 5
Keywords: linux, linux commands, linux command line, linux terminal, linux for beginners, linux commands with examples, linux command line tutorial, linux tutorial, terminal, basic linux commands, linux basic commands, linux tutorial for beginners, linux commands for beginners, linux commands tutorial, linux command line basics, commands in linux, linux shell for beginners, introduction to linux, chris titus tech, history, echo, passwd, df -h, ssh, ip addr, ifconfig, curl, htop
Id: kVlkgiwiY6w
Channel Id: undefined
Length: 16min 18sec (978 seconds)
Published: Thu Jan 24 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.