- So we've talked about working with Linux
and logging in and user accounts a little bit.
It's time to get to know some commands.
So I have put together some of the most useful commands.
These are the commands that you are going to work
with a lot, especially if you're a starter.
It starts with whoami, giving you your login name
in case you're confused about it.
ls for listing files, ip a, which was print your IP address.
Cat, very convenient to show text cells,
passwd for for setting your password,
touch, for verifying writability of specific directories
and pwd for printing working directories.
Let me show you all of these.
All right.
Let me start with whoami.
I am user student and do we have any options?
I would always advise
if you're starting to learn new commands, type command
minus minus help just for the sake
of it to find out if there are any options
and it appears for whoami, there are not
then let's have a look at ls, ls is listing files
listing files in the current directory.
And it has a lot of options.
ls minus minus help is showing you all of these options.
It has so many options
that it doesn't even fit in one alphabet.
Do you see that we have a lowercase x
and we have an uppercase x, for instance.
Now, as I said, ls has a lot of options.
There's two of them that stand out,
ls minus a is showing hidden files
which are files that have a name starting with adult.
And then there is ls minus l the long listing
and you know what?
You can combine them as well and make it ls minus la
which shows a long listing of hidden files.
In the long listing, you can see additional information
about your files, like permissions and owners and creation
date and time, which is all very useful.
We'll talk about it later in much more detail.
The purpose now is just to get you up and running as fast
as possible.
Now we have ip a.
ip a is showing your IP address and what you should be
looking for is your second interface.
The first one is l0. l0 is looping.
That's your internal IP stack, always set to 127.0.0.1.
Look at the second one, ens33.
And it's showing me that I haved IP address 192.168.29.141.
And that can be convenient.
If I want to make my system reachable, then
another one is get, get works on text files.
And you know what?
On Linux, almost everything is stored as a text file.
And if you want to read the contents of a text file
you use get for example, get
on etc hosts, which is a file that you can use
for name resolution.
That is the name belonging to a specific IP address.
As you can see, not much interesting going on here.
Right, then there is passwd.
passwd allows you to change your current password.
If you wanna do that
you need to enter your current password first.
That's your protection, just to make sure
that nobody is changing your password as a joke or so.
And what do I get?
Oh, no bad password.
Password is the same as the old one.
Yes, it is right. And that is
because I did not really want to change my password anyway.
And you know what, if you have root privileges, then passwd
minus minus help is showing so many interesting options
but as you can see a root only
so that means that you need to run them with sudo.
We will talk about that later.
Let me type touch, touch hello
What is touch hello doing?
That will create an empty file with the name hello.
Why is it useful?
Well, that is useful
because in a Linux system, as an ordinary user
you only have a limited write permissions.
And if you want to verify
that you can actually write to a specific location.
Well, touch is an awesome command.
In fact, this thing that I'm doing right here
touch on hello to, to create an empty file
with the name hello?
Isn't even the real reason why touch was created.
Let me do a touch hello again.
And now let me do the ls minus l hello again.
And do you see the difference?
The difference is in the timestamp.
If you use touch
then you are going to change the timestamp on
on the file to the moment when you ran touch.
And that is functionality that can be useful
in backup environments, but honestly
nobody uses touch that way.
People are using touch to verify writability.
And that's something that you are going to do a lot as well.
Finally, pwd
for print working directory, that is showing you the name
of the directory that you currently are in and in Linux.
And we will talk about these directories a lot.
In Linux you won't always see where you are in.
If I type cd slash var slash log for instance,
I only see log.
And if I want to see the complete name, well
pwd and oh, now, now
that we are talking about cd for change directory anyway,
if you use cd followed by nothing
it'll always bring you back to your home directory.
And do you see that you can easily recognize
the home directory by the tilde?
All right.
I think that's all, that's eight commands so far.
Let me throw in one more, which is history.
History is a very convenient command.
It allows you to verify all that you have just done.
So here's my command history.
That's all for this video.
Let's move on to the next topic.