15 Useful Linux Commands Every Linux User Needs | Learning Terminal Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm going over setting up terminal in all the useful commands you need to know to be efficient in Linux so this is a part one series and I'm going over the basic commands and going into some really good tidbits so if you're an advanced user you might get some benefits out of this part two will be more of the advanced commands though just to let you know in this one I go over the very basics at the start so if you're just getting into terminal this would be great for you and I go over some of the customizations of shell and other things but I want to just go ahead and jump into this I want to knock these things out we're going over 15 commands today and let's get into it okay to start out here I went ahead and launch my terminal now you may sit notice this terminal may not look quite like your terminal that's because I'm using a Patric called Terminator now if you're on KDE it's called Kay console if it's your unknown it's called terminal or gnome - terminal there's a lot of different terminals out there I always install Terminator no matter what distribution I'm on it gives me the ability to do kind of really neat things such as going horizontal or I can go ahead and split and what this does when you see this it's called terminal multiplexer it means you can launch multiple things be doing many things at once so let's say I have this oh wait I don't actually have that installed so I'm using pac-man for my package manager but you can do whatever you want if it's apt-get if you're running a Debian install hey that's you know whatever it is so what I did right there is just start at a command or just give you an idea of what it looks like when you're bounced around in this so you can do multiple things and go hey I'm installing a package up here so I'm gonna go ahead and bounce over to this window and do something else please note you know if you are doing package installs you do have to wait for one window to finish before you can do another one because they'll conflict but that is terminal multiplexing or basically multiple tiles in a terminal so the basis here is terminator is I really like it all the other terminals usually have some version of this if you're running on server though and you don't have a GUI or you're unable to do Terminator I highly recommend team ox it was kind of like the very first terminal multiplexer so that is T MUX and it is really good but that is it for the actual basis or the start of terminal and getting it up and going so I'm just gonna go ahead and exit these and we're gonna just stick with the one window today I just wanted to show that another gate go just kind of demystify that the other things that you might have noticed is tab completion and I wanted to go into that real fast so whenever you're typing something in let's say you're going terminate and you can type tab and it actually fills in all the different things and if you press it a couple times it'll give you all the different options so whenever you see me doing things in terminal and you're like well how did he type that so fast it's because I'm using tab to complete what I'm doing so just know that and that's a really good thing to know in terminal starting off so now that you understand how to launch your terminal how to do different windows in terminal and I kind of briefed we briefly went over that and you know I highly recommend going in deep and once you get to the end of this you'll understand how to find all this stuff quickly without having to sit on a web page reading forever so we open our terminal we have tab completion let's talk about the sudo command now sudo is just super user so sudo and then you can type whatever it is and it gives you elevated privileges or is able to run that as super user and I'm gonna link up on the very top there sudo explain and it's an entire like ten minute video about sudo in itself but for the day's video just know when you do sudo and a command it elevates your user to run the command and if you do sudo su we are now running as the root user so whatever command we run it will be run as root just know that if you're doing installations and your route your regular user won't have permissions to death or if you're making directories as the root user it'll be assigned to route that's very important because if we look in our home directory if I go make directory route only and I'm gonna go ahead and do LS LS is your listing command mkdir is actually making the directories so now we made that directory but what are the permissions on it we just expand our LS command or our listing command LS - al this is all files even the hidden ones and if we look on here you'll see the route only right yeah you'll see root only and you'll notice it's not there so as my user let me go ahead and pull up my file explorer here and you'll see that route only is right there but it's got this lock so if I go to crate I can't create a new folder I can't do anything with this folder because it was created as route so very important to know that's why you don't want to stay in route many noobs always do that and for today I'm going to stay in route just so I can run all these commands but no you don't want to stay in route with sudo su just remember su switch user so if I hit exit it exits out of that I'm back as running as my user that I've logged in as so if I wanted to remove that I'd have to do sudo remove directory and for directories you need to do a capital R and I like to do F or force so are the capital R is recursive F for force root and let's see what we got only and now if we do a listing you'll notice that root commands gone so real fast I went over sudo switch user exit LS for that now one thing I did with the LS - a LS - al I mean go ahead and pull this back up you'll notice we didn't see all these but let's say we needed something above h's and we can't see it and we can't scroll up let's say that scrollbar in your mouse and didn't work and for whatever reason or you're in just actual terminal where you don't have access to a mouse you can do what's called the more command so let's do LS - al the pipe symbol now the pipe symbol is above the inner key so you hold shift and press that key above the inner key and type more now you'll see here it's kind of stops and if we hit arrow key down it just does one at a time if we hit spacebar it does a whole page so once it's done you can just simply hold shift and hit ZZ just type that two times so it's to capital Z's and it exits out of the more command so it's really good to use especially when you're in terminal and you don't know what to do so we know how to remove directories make directories remove files you can instead of doing the RM let's say let's let's say we want you to remove a file so let's go into my downloads folder I'm sure there's a bunch of crap here so let's say I wanted to remove fail - stamp I could just go RM and it is case sensitive so just remember that capital F al and then I just hit tab to autocomplete and it removes that file we'll do an LS again boom that file is gone now let's say I wanted to delete scripts now I'm gonna do it incorrectly just to show you what happens says hey this is a directory what the heck so let's do RM - capital R for recursive and F for forced and we'll do scripts M scripts is now gone and that's it we'll go ahead and clean up the rest of this and you see how easy it is just to fly through this and get rid of these files using the RM command now let's say we want to move a file so let's go into images and see what's in there oh okay so quite a bit of stuff so what we can do is move into that now one thing I just missed here is CD so change directory is CD so change directory images to go back you do CD dot dot so you kind of see the dot dot just think of it goes back and let's say you just get completely buried in here you don't even know where your are there's a really good command that you should always remember to use and that is PWD okay so it tells you the path were on so PWD or you know that it's kind of hey you just have to remember that command if you ever get lost but let's say you're in route and you're way out in the middle of nowhere and you're like how do I get back to my home directory you can always do CD tiddly simple now that's above the tab on the top left and it'll go right back to there so let's go PWD and go hey where am I I'm home Titus and to get to route and just go forward like that so that's how the kinda you get around and Linux terminal using all that CD space there's always a space after CD so just remember that so we're going to go back to the home directory we're going to move this images so let's go back into images oh that was in their downloads images so you can actually do multiple steps through just by using that tab so remember start with the down tab and then the forward and then just start typing those in so we're all the way back here and I'm just going to PWD just show you so we're gonna move the sky move or let's copy it so we can move with mm V or if we don't want to just move the file we can do CP for copy in V move CP copy so let's move sky we're gonna move this to my Dropbox folder so that is actually located under my home folder somebody is that idly and then forward slash Dropbox and I like to put this in Photoshop and then I believe stock so this is kind of really going advanced now you see how I'm moving this file all the way to my home directory into Dropbox to photo and it just moves that file so it's gone it's over there so if I go back into the stock which there's a ton of stock photos that I'm always downloading for a thumbnails and other things but that's the basis of moving copying listings and changing directories going over pretty fast here but I want to get through this content just so you can kind of get a good feel so the next up let's say you download an executable script now if you see this dick scam I I wrote this script which I'm going to nano into it which is my text editor I highly recommend you don't use them especially starting out if you're not used to it it's very awkward so from nano here you can kind of see everything I do just make my $50 webcam actually look decent it still looks yeah but it looks a lot better than it does from stock I'd change all these things but I need to go ahead and it run this command so if I try fix cam but that doesn't work so how do I run that script you go dot forward slash fix cam - ah there we go and it went ahead and pushed that and ran that script which is pretty cool now there was some errors there unknown control focus auto alright because I just got on my djaro and I need to install that package that was in that script now let's say I wanted to know what was inside that fix cam but I didn't want to use my text editor to get in like Nano well you can just do cat or think of it as like catalog and fix cam to SH and it just prints all that out I'm still in my shell and it just kind of just showed me what all was in that camera script and I'm like oh hey it's probably this for l2 - CTL or what not that command I need to get so I could easily query that with my package manager and download those packages so that's how you would do it but let's say you got this all command and we're looking at the fixed cam up here actually let's do LS - all listing actually long listing is what I'm looking for all right I left out the a that hides all the things now one thing about directories and files in in Linux is the dot hides the file so if you don't want to see that you just want a long listing LS space - l will just give you all the regular files that and in all those system files are hidden or all those things with a dot before it are hidden so we look here and you'll see that the executable commands there but let's say that that was not the case so let's remove the executable can and let's go ahead and run that long listing again now if I try to run that script you'll notice I can't because there's no executable command and I'm gonna go ahead and link up top permissions explained again that's like a five to ten minute video explaining all these permissions but just know that chmod is very powerful for adding many of these permissions that you need for to do those types of things so if you look at can now run it again so also ownership let's say you make a directory and you want other people to own that thing so let's make a test and I do LS ah alright and you'll see the test directory there it's under Titus Titus well you can do CH own Titus users test and then it's not permitting me because I'm not running as a super user so I can go back into this and just type sudo before this to run and let's do a listing command again and you'll notice that the second one here where it says users well that was actually Titus Titus and now it's tight at users but I could even change it most times when you're under it'll make it as route and you need to go sign it to your user and it would usually be your user and then users it's the group but or you can do to your user for both the name and the group but that's just ownership and again watch that video up there for permissions it really goes into that so let's say you're going going hey I remember that RM command to remove things but I can't quite remember what all the extra syntax was what was that - RF or whatever you can go - - help you're like okay what do I have and then you're like oh you know what can't see that so let's let's just go again - shell but remember that pipe symbol and more and then we can kind of just flip through this so - F is force - R is recursive ah remove empty directories is - D that's a new one - V explain exactly what's being done when it's being done and it gives you the examples below that so that's it so to get out of the more remember shifts easy and we're out so that's a really good command the - - help so remember that helps you but let's say you really need to study this up and that's just not enough you can do what's called the manual command man and then RM and then it gives you the full listing from like the Linux Bible and says hey this is everything and you can come through here go up and back and down and then once you're ready just hit Q to quit so manuals a very good command - helps just like a quick access but if there's a lot to that command you might use manual instead now if you look back here it's kind of hard to read like this I don't particularly like this so a little pro tip I like to do is something called the pager most so let me see I don't think I actually have this package installed so I'm gonna install it real fast so what I'm gonna do here is change the colors and things in it there's a system variable alt page or so if I do an export pager equals most from this package and then let's go back and run that manual and it kind of adds a little flair you don't have to do this I just kind of want to show it if you're a vet watching this is kind of like a pro tip that you can easily it's so much more readable with that that most command or that most package installed and changing the environment variable using export pager command and I'll put all this down in the description so you guys can easily reference all these things I just wanted to throw this out here today and kind of get this going for part 1 part 2 I'm gonna really start diving down and kind of showing you how a systems administrator would work in terminal and show you more of the higher level commands at least get you into some other things [Music]
Info
Channel: Chris Titus Tech
Views: 187,783
Rating: 4.8615885 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, sudo, su, exit, ls, more, cd, mkdir, rm, mv, cp, chmod, chown, help, man
Id: XK81cfvrElg
Channel Id: undefined
Length: 18min 52sec (1132 seconds)
Published: Sat Jan 19 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.