So host name, right? Well, I would say Man K host name.
The powerful thing about Man K is that it doesn't only search in the
names of your commands, it also searches in the description for your commands.
We can see a couple of them. And do we have anything in either section one or section eight?
Well, look at that. We have hostnamectl control the system's host name. You know what?
I'm going to use it right now because my system has a host name, localhost.
I don't like that.
So let me use hostnamectl.
How do we use hostnamectl?
Well, in case you don't know, I would recommend you use hostnamectl.
And there we have the hostname option which allows you to get or set the system hostname.
So hostnamectl hostname linfen.example.org and
that's setting the host name.
Hey, then why don't I see it?
Well, that's because of something very generic in Linux.
In Linux, if you change configuration often, you need to restart in order to read the configuration.
Does that mean you need to restart your entire system? Well, ultimately that
would always work, but in many cases it can be done easier.
Here I'm in my terminal window and I'm just going to use exit to get
out of my terminal window and then I'm going to start my terminal window again.
And as you can see, it's now showing Linfen as my host name. So
that was part one, part two of the lab help output for ip IP
help. And we need to find how to bring down a link.
Oh my goodness. Here we can see how IP is used. IP is followed by an object.
The object is next level command.
I can see there is a link object.
I'm going to use IP link help.
There we can see that in this command help doesn't work,
but it's providing help anyway. So we need IP link help.
And that is showing what we can do with this link.
That's a lot of options.
What we probably need is right here, IP link set.
And then between the curly braces, you remember a structure like this means that you need to make a choice.
IP link set device.
Then I'm going to use down.
The only thing now is that I need my device name.
That will be IP link show.
There we can see ENS160. So I'm using IP link set ENS160 down.
That should bring it down. Oh boy, I'm getting an operation not permitted.
Does that make sense?
Yeah, it does, because I'M trying to change the state of my system and in order to
change the state of my my system I need to put sudo in front of my command.
Now I have a dilemma. My cursor is at the end of the command line. Do you really think I'm
going to press the left arrow key 20 times or so to get to the start of the command line?
Of course not. The control A key sequence is convenient here that moves the cursor to the start of your command line.
Then I'm using sudo followed by the command that I want to set that prompts for my sudo password.
Now if I use IP link show then I
can see that the link state is down.
That's not very convenient because that means that I don't have networking anymore. I like it if I have networking.
Let's go and do an IP link set ENS160 up again to make it available again.
Now we're all good and ready for the next lesson.