- All right.
So we need man in related to resources,
to find out how to change the hostname of your computer.
Well, I would say let's start with man,
man -k hostname,
which is bringing me a reasonable amount of commands.
That is all almost too easy.
And I can see there's hostname and there's hostnamectl.
hostnamectl, control the system hostname.
That's the one that we need.
So how do we use that?
Well, let's use man on hostnamectl.
And there we get the description of the hostnamectl command.
So does it have any help?
It doesn't have any help?
And if it doesn't have any help
that means that it should be possible
to figure this out in a real easy way for yourself.
And as you can see,
there are options and there is, well, you know what?
I don't feel like reading all of this.
Let's use hostnamectl --help for the quick overview.
Now this is cool.
This is what I need.
And I can see that we have a hostnamectl hostname,
which can be used to get set hostname status.
So, hostnamectl hostname centos
will set the hostname for my current system.
It'll set it for something that it already was.
Does that matter?
No, not really.
What matters is that, you know
that this is how you use hostnamectl.
Then we have the second part of the lab.
Read the help output for ip,
and find how you can bring down a link.
ip --help, is that going to be something useful?
Well, at least it is showing what we can do.
And this is voted number one
most user unfriendly help output.
So let's study, how does this work?
ip OBJECT.
So we have an OBJECT
and the objects are specified right here,
and these are all the objects.
So I need to do something with a link.
Now, look at that, we have ip link.
And then we have a command behind the OBJECT,
well, I don't know which command to work
but ip link --help.
Is it going to bring us any further?
Well, in a certain way it does,
because it's telling me --help is unknown.
Type ip link help.
Okay, let's type ip link help.
And there we go.
And oh boy, oh boy, oh boy.
That is a lot of information.
So let's scroll up a little bit
where we can find ip link set DEVICE up down.
Hey, ip link set DEVICE up down.
Well, what is DEVICE?
DEVICE is your network device.
ip a, as we have seen before, is ens33.
So ens33 is my network device.
ip link down ens33, something like that.
And oh, no.
Command down is unknown.
Command down is unknown?
Did we overlook something?
Well, let's do another ip link help,
and scroll up because for some reason,
the pipe doesn't work here.
And ah, there, I see, I miss it.
ip link set is the command.
So we need ip link set ens33 down.
Let me try again.
ip link set ens33 down.
Uh-oh, operation not permitted.
Do you have anything?
What is going on?
Of course you do.
This requires sudo superpowers.
So let's learn the command again with sudo in front of it.
It's prompting for my sudo password.
And there we go.
At this point, the link is down.
And if I type ip a again,
then right here in the state, we can see that it is down.
Can we bring it up again?
Well, if you remember the output of the help,
there is also ip link set whatever up
to bring the link up again.
And ip a is our final command.
Uh-oh, this is a typo.
And I did this on accident
but it's useful to see this typo.
I used ip a with the back slash behind it.
The back slash means that the Linux shell
expects us to continue on the next line.
So it's opening what we call a secondary prompt.
This > is our secondary prompt,
but I don't wanna be here.
So how do I get out?
Well, CTRL + C is always a good guess.
I'm using CTRL + C to interrupt,
and now I can repeat the command by pressing the Up Arrow,
and we can see that the link is up again.
And that means that we are good.
And that's all that you needed to do for this lab.
Let's continue with the next lesson.