So we've seen some useful commands for getting around the command prompt in Lennix, few useful commands
for files.
Let's see just a few more advanced commands.
We're gonna see how to get help on commands.
We'll use the super user, do command, and then we'll see some things that we can use to find a file
or to do a little bit of networking, checkup and other advanced features.
So first of all, any time we want to do something with elevated privileges, something that a super
user, a route or administrator would do.
We use the super user do or pseudo sue, do as you know, super user do.
You'll hear people call it pseudo.
We'll say pseudo.
And then we'll give it command.
That would impact the system or install software.
So if we do a pseudo apte get install, say, Python three.
Then that would let us run as an administrative user and install some software using the APTN get.
So the app to get installed, Python three, would go out and find Python three.
I'm not going to do that right now.
Sometimes you want to restart services.
For example, you might say pseudo service.
Network manager restart.
And that will restart our networking for us.
Meaning tell me to do something with elevator privileges looking inside other user directories.
For example, if you're doing a search, you may have to do a studio to find out where files are located.
Well, speaking of finding where files are located, let's see to our the root of the machine, not
our root home directory CV to the base file system.
Enough I do a L.
S, I can see I'm out at the base of this Caleigh Linux machine.
I've got things like user cysts, temp, lots of home folders there for our users.
So I've studied space selection at Forward Slash takes me to the root of the file system.
And now I can do I find command, find Dasch name.
Let's find all the user's desktop folders.
Well, it turns out we've just installed a basic Kelly Linux box here, so there's only one desktop
and it's in my folder route.
But let's say we wanted to find all the files named desktop or with desktop in the name at all, we
can use the locate command.
And we can locate desktop.
You see, there are lots of places in a default, Kelly, Linux install that have desktop in the file
name.
Let's say that we created one.
So let's let's clear the screen and let's create a file called desktop right here.
So I m k d i r desktop.
And unify LDS.
I see my new folder.
Desktop is here.
So now if I do a locate, if I do a locate desktop.
You see, it doesn't find that base directory desktop.
Well, that's because I have to update the DBI.
The locate is a quick indexed search for files and the DBE, the update DBI command will now let us
locate desktop.
And notice it has found it now.
And that's much faster than doing a find by name.
Find that name because it's an indexed search.
So that update DBI goes through all the directories and finds all the files locate is a really quick
way to find files when you need to.
Another really useful command is the manual command.
So if I say man locate, it gives me the entire manual on the locate command and I can control see or
actually I can cue to get out of this or I can just say locate space and then do a dash dash help.
In fact, just about all of the commands in Linux, I can do a man space in the name of the command
or I can do the command and then space dash dash help and I'll get more information.
Let me demonstrate that with the copy command.
I can do man c.p.
I see the manual for the copy command and there are lots of commands under there and I'll quit to get
out of there.
Or I can say CPS space dash dash help get one big long help screen.
With all the command line options for the copy command.
Very cool.
Let's do a couple of advanced commands for networking, let's say that I want to ping.
W w w dot Google dot com.
Ping is a network command that lets us see whether we've got connectivity out to the Internet, for
example, or to a specific server.
I'm pinging Google and that's going to keep going.
So I'll control.
See, anytime you want to kill a command from the command, prompt control see is usually the way to
do it.
But I can ping out to Google because this is set up public or I could ping around to other locations
if I clear the screen and do an I f config.
This is my interface config.
I-F config tells me that I am setup with this internet address and I always have a looped back address
127 to zero dot zero.
That one is always my local host.
That is my loop back or a local host address.
But out on the Internet it looks like I have an address like 10 dot audette to that 15 because of the
default setup in virtual box.
So remember, on a Linux box, anytime you need to know your IP address, you can use I-F config interface
config on a Windows machine.
That'll be IP config.
So it's easy to get those mixed up.
Just remember I-F config for Linux and then IP for Windows.
Let me clear the screen.
And one last thing that's helpful to do sometimes is just list all your environment variables.
E in the.
And you can see every named constant.
So if I say want to know where my home directory is or what my user name is, I can echo those variables
out just by using a dollar sign next to this.
The name of the variable that we see here.
So let me clear the screen and echo dollar sign user and I'm logged in as root, whereas my home directory.
I go to our sign home says slash root.
So if I see enter and then my home directory and I can check that with P WD, my present working directory.
So we had a whole lot of Linux commands in there from Ellis all the way through P WD.
We've seen some networking commands, some file commands.
It's a lot to catch all at one time.
So I'll post the PDA file so that you get a good cheat sheet to go back to in the next list.
And we're going to see how to do the same commands in a Windows command line environment.