Hello and welcome to Command Line
Basics. This video we're going to
learn about the basics three
Christopher.
And let's begin
so our learning objectives for this
video, we are going to learn to
locate command of the NATO command
and understand the pseudo command
pre assessment by
default. Which user account
does pseudo use?
Is it A administrator,
B, guest C
system or D
route?
The answer is D route.
This is the default account that
pseudo is going to use unless
you tell it very specifically
otherwise.
And pseudo is a command you're going
to become very familiar with when
you're using Linux because you're
going to constantly need to elevate
your permissions to either install
files, connect new things to the
system, pretty much anything
you can imagine.
So it's very important to
be able to be comfortable with Tudo
and learn how to use it.
The administrator is for Windows.
The guest account is not
used by default.
Biasutto in the system account
is kind of like the root account
for a Windows machine, not
for Unix machine.
So our first command is located.
Now, what Loki does is it is
a command that helps us find files
on the file system and
it is very, very speedy because
it reads indexing databases
that are constantly indexing your
files on your machine in the
background.
So the way to use it, we'll just
type in, locate and then
what we're searching for either
the beginning of the file name or
something along those lines.
So this is very useful if I know
that I have a specific file
on my machine, but I don't know
where it's at.
So by typing locate, it'll
show us where exactly
where that file is.
Now, in order to update the indexing
manually for the locate command, we
can use the update DB
Command.
So let's take a look inside
of a Linux machine.
Now I'm going to see what's inside
of my directory
here.
So let's say I have this
my program and
I'm going to go back to my desktop
type CD space.
Dundon Now
let's say I know I have a
file called my program
in in my system somewhere,
but I don't know exactly where.
So I'm going to type locate my
program
and then we go to
spaces. So this
is the Home User
Desktop Files program.
This is from this
output right here.
So I know that's where it is.
And then I had a drag and
drop where I was
dropping my program into this
virtual machine.
So I know I have a copy of it there
as well. So that's good to know.
Now, the only kind
of drawback with the low key command
is that if you add new things
and you're trying to find them,
you're usually the indexing
in the background, hasn't had a
chance to index it, to search
through it with the LOCATE database.
So let's give a brief
explanation of that.
So I'm going to do touch and
this is
new.
Now, if I look in this directory, I
can see I have the this is
new file.
Now, if I try and locate
let me spell it correctly.
This is
new. It's going to come back
with nothing.
Now, this is because it has an
indexed it year.
So if we type the update DB command,
you will see we do not have
permissions.
So this is something we're
going to cover in the sudo portion
of this video.
So hang tight.
All right, Nano with the Nano
Command is is it is a very basic
text editor that is a
very useful and user
friendly at the command line.
So Nano is something that you need
to be very familiar with because
you're going to need to be able to
edit files or text
inside of the command
line. So it's similar to them.
If you talk to a programmer, they're
going to tell you they use VI
or Vem.
If you just beginning at the command
line don't feel bad, just use NENO.
It's very user friendly and
there's not a big barrier to learn
how to use Nano.
So and it's also very useful because
you can open it to see what's inside
of a file, change it, save it,
and you can also create a file with
Nano as well.
So if a file doesn't
exist when you type in the document,
it'll automatically make it for you.
So I'm going to go back to my Linux
machine and let's say I
want to
let me go into my
files folder
else. And now let's say I want to
look into the words that
I want to change something in there.
So I'm going to do neno words
that I
could see. I have all these words
and if I want to move around, I can
just use the Iraqis.
And in order to type something
in, I can hit
enter just like any other text
editor or word or something
is
right.
And now you can see we have this is
our new line in there twice so
we can go ahead and type in there
and plug
the command line.
Look at that.
And now we can see in the bottom
here, too, we have all sorts of
different options for us to be able
to use.
So in order to save
it, we can write out which is the
control. Oh, and
then hit enter.
And that will give us it'll save
it back to the system now to
exit the control X
and we're automatically back.
All right.
And then we have the pseudo command.
It is very important because it will
allow you to run commands
as rup.
So like we were saying and
we were shown with the update DB
Command, we couldn't run it because
we weren't running as root.
And if you're not familiar with
Root, it is kind of the super user
for Linux. The system account
for Linux where everything
and anything can be done to the
system.
So in order to run these indexing in
the background, we're going to need
to run pseudo
and then update DB.
So let's go back here.
I'm going to type pseudo
update DB.
It's going to ask me for my password
and there we go.
So I didn't get any errors, which
is a good sign.
Now let's say
locate this
is name
and check it out.
So the indexing ran because we told
it to update the database
and now we have ah this
is new file.
So this is a really good way in
order to verify that the
pseudo command works and
that our update DB works
so we can find these files.
Now, if you want to have a shell for
root, all I have to do is type
pseudo dash s.
And as you can see, I
am now root.
So this is a very good way.
In order to have that
interactive Shettleston
Post assessment, the Nano
Command will make a new file if
one does not exist.
Is this true or false?
The answer is true, if you were
using Nano and you type Nano
in a new filename, it will
automatically create that file.
That way, you don't want to worry
about creating that file first, then
opening it with the chain of
command. You can just go ahead
and start typing away.
All right, so in this video, we
learned the locate command, we
learned the national command and
understood the command and
just like the other videos are all
very important to have in your
arsenal for the command line.
And I hope to see you in the next
video.