1 00:00:06,960 --> 00:00:11,210 So host name, right? Well, I would say Man K host name. 2 00:00:12,609 --> 00:00:17,699 The powerful thing about Man K is that it doesn't only search in the 3 00:00:17,699 --> 00:00:22,789 names of your commands, it also searches in the description for your commands. 4 00:00:24,309 --> 00:00:31,230 We can see a couple of them. And do we have anything in either section one or section eight? 5 00:00:32,159 --> 00:00:37,739 Well, look at that. We have hostnamectl control the system's host name. You know what? 6 00:00:37,739 --> 00:00:43,319 I'm going to use it right now because my system has a host name, localhost. 7 00:00:43,619 --> 00:00:44,259 I don't like that. 8 00:00:45,380 --> 00:00:48,399 So let me use hostnamectl. 9 00:00:50,340 --> 00:00:51,939 How do we use hostnamectl? 10 00:00:53,060 --> 00:00:57,619 Well, in case you don't know, I would recommend you use hostnamectl. 11 00:00:59,500 --> 00:01:03,659 And there we have the hostname option which allows you to get or set the system hostname. 12 00:01:04,579 --> 00:01:09,284 So hostnamectl hostname linfen.example.org and 13 00:01:09,284 --> 00:01:13,989 that's setting the host name. 14 00:01:14,650 --> 00:01:16,310 Hey, then why don't I see it? 15 00:01:16,909 --> 00:01:19,609 Well, that's because of something very generic in Linux. 16 00:01:20,250 --> 00:01:26,140 In Linux, if you change configuration often, you need to restart in order to read the configuration. 17 00:01:26,810 --> 00:01:30,460 Does that mean you need to restart your entire system? Well, ultimately that 18 00:01:30,460 --> 00:01:34,110 would always work, but in many cases it can be done easier. 19 00:01:35,329 --> 00:01:40,060 Here I'm in my terminal window and I'm just going to use exit to get 20 00:01:40,060 --> 00:01:44,790 out of my terminal window and then I'm going to start my terminal window again. 21 00:01:45,730 --> 00:01:50,456 And as you can see, it's now showing Linfen as my host name. So 22 00:01:50,456 --> 00:01:55,183 that was part one, part two of the lab help output for ip IP 23 00:01:55,183 --> 00:01:59,909 help. And we need to find how to bring down a link. 24 00:02:00,909 --> 00:02:06,659 Oh my goodness. Here we can see how IP is used. IP is followed by an object. 25 00:02:07,219 --> 00:02:09,789 The object is next level command. 26 00:02:11,750 --> 00:02:13,439 I can see there is a link object. 27 00:02:14,120 --> 00:02:16,349 I'm going to use IP link help. 28 00:02:19,610 --> 00:02:23,225 There we can see that in this command help doesn't work, 29 00:02:23,225 --> 00:02:26,840 but it's providing help anyway. So we need IP link help. 30 00:02:27,500 --> 00:02:31,370 And that is showing what we can do with this link. 31 00:02:32,949 --> 00:02:35,349 That's a lot of options. 32 00:02:36,689 --> 00:02:39,729 What we probably need is right here, IP link set. 33 00:02:40,629 --> 00:02:47,469 And then between the curly braces, you remember a structure like this means that you need to make a choice. 34 00:02:48,960 --> 00:02:50,330 IP link set device. 35 00:02:51,240 --> 00:02:53,409 Then I'm going to use down. 36 00:02:53,990 --> 00:02:56,599 The only thing now is that I need my device name. 37 00:02:57,979 --> 00:03:01,020 That will be IP link show. 38 00:03:02,060 --> 00:03:08,800 There we can see ENS160. So I'm using IP link set ENS160 down. 39 00:03:11,139 --> 00:03:15,289 That should bring it down. Oh boy, I'm getting an operation not permitted. 40 00:03:15,810 --> 00:03:16,629 Does that make sense? 41 00:03:17,150 --> 00:03:21,475 Yeah, it does, because I'M trying to change the state of my system and in order to 42 00:03:21,475 --> 00:03:25,800 change the state of my my system I need to put sudo in front of my command. 43 00:03:27,000 --> 00:03:31,764 Now I have a dilemma. My cursor is at the end of the command line. Do you really think I'm 44 00:03:31,764 --> 00:03:36,529 going to press the left arrow key 20 times or so to get to the start of the command line? 45 00:03:37,069 --> 00:03:43,870 Of course not. The control A key sequence is convenient here that moves the cursor to the start of your command line. 46 00:03:44,409 --> 00:03:50,699 Then I'm using sudo followed by the command that I want to set that prompts for my sudo password. 47 00:03:51,379 --> 00:03:54,909 Now if I use IP link show then I 48 00:03:54,909 --> 00:03:58,439 can see that the link state is down. 49 00:03:59,560 --> 00:04:05,449 That's not very convenient because that means that I don't have networking anymore. I like it if I have networking. 50 00:04:05,949 --> 00:04:11,120 Let's go and do an IP link set ENS160 up again to make it available again. 51 00:04:11,900 --> 00:04:14,169 Now we're all good and ready for the next lesson.