5 More Linux Terminal Commands for Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there i'm gary sims and this is gary explains now i really hope you enjoyed my 10 linux terminal commands for beginners video if you haven't seen it there's a link to it just up here now in that video I explained that originally I recorded 15 commands but the video was just too long so I cut it off at 10 now I asked you did you want to see the other 5 the overall whelming response has been yes you'd like to see the other 5 so what's coming is the other 5 commands now just one quick warning the video starts abruptly I haven't rerecorded anything because it's litter I just cut it off at 10 and kind of just made this second video so it just literally carries on where the other video left off so if you want to know 5 more commands for the Linux terminal please let me explain now of course if you've got all these long lists of things for example if we now look at the male first names this is from some sense as data it tells that James and then John Robert are the most popular names at the time this sensor was take sense of taking now this is quite long file and so if I wanted to find Gary in here for example how would I do that how would I find Gary well one very important command for doing that is the word grep okay so it means to find a text inside a file so we could do gap grep Gary I'm using capitals because all the names that are in capitals and then we can do male first names and it just finds and prints out that one line so gary is the 26th most popular name in that list now of course I could also just search for all the names I've got ger in it because maybe there's Gary the two hours for example or gareth or other variations so of course i can now just do gret gar and here we see we've got Gary Edgar Gary the two hours gareth and garrett and so loud so here we can see all of the variations of those names that have got kind of G a R and them both at any point in the name it doesn't say at the beginning or so on now there are advanced commands for grep that we could do that will tell us to search for at the beginning at the end of zone and we'll leave that for a from video one thing I will want to show you though is if you do - I it means ignore case and now I can search for Gary in that file and even though I've typed Gary lower case it still found Gary upper case because it's ignoring the case as it tries to match it now we can do more about gret in future videos because it is a very powerful command there's many more things we can do with it but this is a good way just to see you can search quickly through a file now of course we could search through all files so if we do grep and let's just look for - I GA star dot txt we actually find that there is Michigan is in the state's file of course there and then of course there was all these other ones in the in the names so that gives us the answer to our search across multiple files ok moving on there's one other a few other commands I want to show you one is called WC which is for word count so if I do word count 50 states dot txt this will tell me how many words how many lines and how many letters there are in the file and so we can see that there are 50 lines 60 words and 472 letters and of course that's handy because there are 50 states so I'm glad there were 50 and you can pass in some parameters for example you can do word count - L which will only show us the number of lines and there you can see it comes up and said there are 50 ok so now the next one I want to show you is about the processes now on a multi-user system where we're using a multi processing you running multiple processes at the same time and at the moment you can list what processes you're using using the PS command ok and at the moment this tells me two things it tells me I am running bash which is the name of the command line ok the SH there being four shell that's what the the word is from Linux and UNIX the shell are you using so I'm using bash ok and it also tells me at the moment that the command was run a PS command was running so there were two things running the shell itself and the PS command now that just tells me what I'm running in my private area PS aux now here I get a list of basically everything that's running on my little Raspberry Pi so as you can see there are loads of processes running okay load the ones in square brackets our kernel processes just so that you know they belong to the kernel itself and then here are all the different user processes that are running okay and this is great for seeing what processes are running if there's a program that's gone funny you can maybe you can kill it you can change priority of processes what you can do a process we'll leave that again for another video and the reason we've done that is because there's a really important aspect of running processes on Linux and that is that you can actually start your own processes and you can actually stop them just bat your own private process now one really important way to do that is when you're if you're doing a command are editing a file now I'm going to show you a command called Nano there are this is a text editor is the most user-friendly text editor there's another one called vie or vim which I suppose we will also cover in a more advanced video but let's just look at Nano and let's edit Nano 50-state and that gives me a very nice text base Eddy here I can scroll up and down you know I can change things and save them and so on but with Linux what the great thing is at this point I could exit this by saving it and Xing out of it or I could just suspend this and go back to the command line and the way you do this by pressing ctrl + Z at the same time now notice who's I did that it says here there's one stopped process which is called Nano and that's exactly what's happened it's it's stopped now I am back now to the command line I can do LS I can do CD into downloads and all that kind of stuff and if I type FG which means go back to the foreground bring that task in the background to the foreground it will take me back into Nano so obviously when we're using desktops we're used to switching between Windows and doing things maybe in a multitasking way but now with this we can actually do multitasking from the command line and the great thing is we can do it multiple times and now if we at nano colors text ok so here's my list of colors ok and if I come out of that now and go back i've actually now got to pull jobs in the background and if I type the word jobs then I can see both of them there look stop nano 50-state and stopped nano colors and I can switch to either than I can do air FG % one takes me back into the 50 states and let's do jobs again and if I want to go back into colors I do FG + 10 - ok a map now allows me to switch between the different tasks that are running and there are other things you can do with FG from the command line but I just wanted to show this idea that you don't have to always exit and save you can just kind of stop suspend the job go and do something else find that file that you want it and then go back into the editor back into what you were doing to carry on so that's kind of control Z to do it and then FG to switch back into the tasks that you have suspended okay as I said there's lots more we could do with that and that will be for advanced fit now if you are using nano you use control X it says so down here on this help bar hey look control X to get it out do want to save it I'm gonna say no and that just gets me out of there I do FG again I go back into the MIT other one which is the 50 states when Control Act or want to save it no and there I'm back and if I type jobs I've got nothing suspended at all and there I am back so there you go 15 really really useful commands for getting you started on the Linux command line but I really hope you enjoyed those 5 extra commands please tell me in the comments below if you'd like to see more videos on the Linux terminal there's obviously load more stuff we can cover this is really just the beginning really I think the next one would be about pipes and redirection so if you don't know about pipes and redirection let me know in the comments below you also know what I'm going to ask please subscribe do hit that Bell notification icon become part of the notifications squad do give it a thumbs up and do please share this video on social media okay that's it I'll see you next one
Info
Channel: Gary Explains
Views: 32,162
Rating: undefined out of 5
Keywords: Gary Explains, Tech, Explanation, Tutorial, linux, linux command line, linux commands, linux shell, bash, ps, nano, wc, grep
Id: nbXwdIhR0HE
Channel Id: undefined
Length: 8min 37sec (517 seconds)
Published: Thu Apr 12 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.