1 00:00:06,840 --> 00:00:09,240 - In this video, we are going to talk about man. 2 00:00:09,240 --> 00:00:10,470 What is man? 3 00:00:10,470 --> 00:00:13,470 Man is the System Programmers Manual. 4 00:00:13,470 --> 00:00:17,490 And you know, it goes all the way back to the early 1970s 5 00:00:17,490 --> 00:00:20,070 when the first Unix systems were introduced 6 00:00:20,070 --> 00:00:23,820 and the developers created the man pages actually 7 00:00:23,820 --> 00:00:24,810 on a typewriter. 8 00:00:24,810 --> 00:00:27,420 And if you ever go to Mountain View in California 9 00:00:27,420 --> 00:00:30,930 you can still see them in the Museum of Computer Science. 10 00:00:30,930 --> 00:00:31,967 Very interesting. 11 00:00:31,967 --> 00:00:35,430 Nowadays, it's not printed pages anymore. 12 00:00:35,430 --> 00:00:37,770 It's an online system that you can use 13 00:00:37,770 --> 00:00:40,200 by accessing the man command. 14 00:00:40,200 --> 00:00:42,060 The man command is very important. 15 00:00:42,060 --> 00:00:45,330 You should make sure that you are very familiar with it. 16 00:00:45,330 --> 00:00:48,090 And that is because the man command is the main 17 00:00:48,090 --> 00:00:49,260 but not the only source 18 00:00:49,260 --> 00:00:53,160 for getting information about Linux command usage. 19 00:00:53,160 --> 00:00:55,680 Now, the thing is that Linux is open source 20 00:00:55,680 --> 00:00:58,680 and in open source, you have people who do what they want. 21 00:00:58,680 --> 00:01:00,810 The result is that very frequently in Linux 22 00:01:00,810 --> 00:01:04,710 you will see different solutions for the main problem. 23 00:01:04,710 --> 00:01:08,700 But if one solution is really better than the other ones 24 00:01:08,700 --> 00:01:10,800 it will become the dominant solution. 25 00:01:10,800 --> 00:01:13,443 And that is what has happened with with man. 26 00:01:14,370 --> 00:01:16,230 So man is the main source 27 00:01:16,230 --> 00:01:19,530 for information about Linux command line usage. 28 00:01:19,530 --> 00:01:21,300 And you use it to get information 29 00:01:21,300 --> 00:01:24,390 about commands, configuration files and more. 30 00:01:24,390 --> 00:01:27,420 Before I show you all the information on the next slide 31 00:01:27,420 --> 00:01:29,430 let me already give you an impression 32 00:01:29,430 --> 00:01:31,023 of what man is all about. 33 00:01:33,180 --> 00:01:34,290 So here we are. 34 00:01:34,290 --> 00:01:38,021 And let me, let me type man who am I. 35 00:01:38,021 --> 00:01:39,690 I'm starting with a simple command. 36 00:01:39,690 --> 00:01:40,740 And what do we see? 37 00:01:40,740 --> 00:01:43,800 We see a man page that actually fits on one page. 38 00:01:43,800 --> 00:01:47,100 And there's not many of them as you will discover later. 39 00:01:47,100 --> 00:01:47,940 So what do we see? 40 00:01:47,940 --> 00:01:49,650 First line, this is the header line. 41 00:01:49,650 --> 00:01:51,600 And isn't that surprising? 42 00:01:51,600 --> 00:01:52,800 Do you remember what I said 43 00:01:52,800 --> 00:01:55,320 about Linux being case sensitive? 44 00:01:55,320 --> 00:01:57,570 Well, from that perspective, it's kind of weird 45 00:01:57,570 --> 00:01:59,730 that the first line is the header line 46 00:01:59,730 --> 00:02:02,280 and we see the command in uppercase. 47 00:02:02,280 --> 00:02:06,728 And that is so for all the items that are documented in man. 48 00:02:06,728 --> 00:02:08,820 That's a tribute to history. 49 00:02:08,820 --> 00:02:13,820 The original man pages were created on a typewriter 50 00:02:13,890 --> 00:02:17,040 and on the typewriter, the author used uppercase 51 00:02:17,040 --> 00:02:19,230 for the command on the first line. 52 00:02:19,230 --> 00:02:22,350 Behind the command, who am I we can see the number one. 53 00:02:22,350 --> 00:02:24,810 Number one is about the man section. 54 00:02:24,810 --> 00:02:27,120 Man is organized in sections 55 00:02:27,120 --> 00:02:30,420 and we should try to understand these sections 56 00:02:30,420 --> 00:02:32,400 but we'll do that later. 57 00:02:32,400 --> 00:02:34,500 For now, let's have a quick glimpse 58 00:02:34,500 --> 00:02:36,210 of what we see right here. 59 00:02:36,210 --> 00:02:37,710 So we have name. 60 00:02:37,710 --> 00:02:38,970 That's the name of the command 61 00:02:38,970 --> 00:02:42,450 including a short summary of what the command is used for. 62 00:02:42,450 --> 00:02:43,890 Now, we have the synopsis. 63 00:02:43,890 --> 00:02:46,020 The synopsis is the name 64 00:02:46,020 --> 00:02:49,170 of the command followed by option. 65 00:02:49,170 --> 00:02:51,270 Now look at the way, how option is written. 66 00:02:51,270 --> 00:02:54,000 Option is written between square brackets. 67 00:02:54,000 --> 00:02:57,510 If in men output or in help, output in general 68 00:02:57,510 --> 00:02:59,840 anything is between square brackets that means 69 00:02:59,840 --> 00:03:01,650 that it is optional. 70 00:03:01,650 --> 00:03:03,300 Which means that you can use it. 71 00:03:03,300 --> 00:03:04,650 You don't have to use it. 72 00:03:04,650 --> 00:03:06,570 It's not mandatory. 73 00:03:06,570 --> 00:03:07,830 So you can use options 74 00:03:07,830 --> 00:03:09,780 and the options are listed right here. 75 00:03:09,780 --> 00:03:12,510 It's not very much in the who am I command 76 00:03:12,510 --> 00:03:14,520 as we have seen before. 77 00:03:14,520 --> 00:03:17,453 Behind the option, we have dot dot dot. 78 00:03:17,453 --> 00:03:21,540 Dot dot dot is a modifier of what you see before the option. 79 00:03:21,540 --> 00:03:23,640 It means that you can have multiple of them. 80 00:03:23,640 --> 00:03:26,160 So you can use who am I with one option 81 00:03:26,160 --> 00:03:27,510 or with many options. 82 00:03:27,510 --> 00:03:30,210 And then you get the additional information, the author, 83 00:03:30,210 --> 00:03:34,710 the reporting books, the copyright, and also the see also 84 00:03:34,710 --> 00:03:38,220 which is telling you that this is not the real information. 85 00:03:38,220 --> 00:03:39,870 You should use the info command 86 00:03:39,870 --> 00:03:41,970 to get access to the real information. 87 00:03:41,970 --> 00:03:43,980 I'll tell you about that later. 88 00:03:43,980 --> 00:03:46,410 For now, I want to show you another man page. 89 00:03:46,410 --> 00:03:48,150 And that is man, man. 90 00:03:48,150 --> 00:03:51,570 Oh, yes, man itself has a man page as well. 91 00:03:51,570 --> 00:03:53,610 It's a little bit more complicated. 92 00:03:53,610 --> 00:03:56,340 And I want you to understand what we see. 93 00:03:56,340 --> 00:03:58,050 It starts with the synopsis 94 00:03:58,050 --> 00:04:03,050 and in the synopsis you can see the different uses of man. 95 00:04:04,110 --> 00:04:08,910 So we can use man with man options, which are optional 96 00:04:08,910 --> 00:04:10,860 which specific sections and pages 97 00:04:10,860 --> 00:04:13,860 in which section is optional to the page 98 00:04:13,860 --> 00:04:15,390 in which you can have multiple 99 00:04:15,390 --> 00:04:18,420 of them and multiple of the preceding item as well. 100 00:04:18,420 --> 00:04:20,610 Wow, is that difficult to read? 101 00:04:20,610 --> 00:04:23,580 I think it is, but this is the man page of man. 102 00:04:23,580 --> 00:04:24,413 And I would say 103 00:04:24,413 --> 00:04:27,030 if you wanna know more about it, just continue reading. 104 00:04:27,030 --> 00:04:30,360 You will find the explanation in the description. 105 00:04:30,360 --> 00:04:31,890 What you also need to know is 106 00:04:31,890 --> 00:04:33,810 that here we have different use cases. 107 00:04:33,810 --> 00:04:37,860 So you can use man minus lowercase K, man minus uppercase K, 108 00:04:37,860 --> 00:04:40,920 minus F, minus L, minus w. 109 00:04:40,920 --> 00:04:45,750 And all of these are documented further in the man page. 110 00:04:45,750 --> 00:04:47,220 Hey, this is an interesting one. 111 00:04:47,220 --> 00:04:49,380 We should explore this one as well. 112 00:04:49,380 --> 00:04:53,820 So minus w in lowercase, as well as uppercase. 113 00:04:53,820 --> 00:04:57,270 What is this construction with the pipe sign in the middle? 114 00:04:57,270 --> 00:04:59,040 Well, this construction with the pipe sign 115 00:04:59,040 --> 00:05:02,880 in the middle means that you need to select one of them. 116 00:05:02,880 --> 00:05:04,170 You can't use both. 117 00:05:04,170 --> 00:05:06,270 So it's either minus lowercase w 118 00:05:06,270 --> 00:05:11,270 or minus uppercase w to do whatever you want to do. 119 00:05:12,228 --> 00:05:16,080 You will also notice that this minus w is sometimes written 120 00:05:16,080 --> 00:05:18,390 with curly braces around it. 121 00:05:18,390 --> 00:05:23,310 So man curly brace minus w pipe minus w closing curly brace. 122 00:05:23,310 --> 00:05:25,110 It's exactly the same. 123 00:05:25,110 --> 00:05:27,210 Now, the reason that we are really here is 124 00:05:27,210 --> 00:05:29,400 because of the section numbers. 125 00:05:29,400 --> 00:05:31,470 Here, we have the sections. 126 00:05:31,470 --> 00:05:32,580 How should you see that? 127 00:05:32,580 --> 00:05:34,590 See it as chapters in a book 128 00:05:34,590 --> 00:05:37,260 and every chapter is defining its own things. 129 00:05:37,260 --> 00:05:39,750 Here we have section number one, which is 130 00:05:39,750 --> 00:05:43,440 for executable programs or shell commands. 131 00:05:43,440 --> 00:05:44,640 Section number one. 132 00:05:44,640 --> 00:05:48,663 This is commands that you can use as an ordinary user. 133 00:05:48,663 --> 00:05:50,430 There is section number eight. 134 00:05:50,430 --> 00:05:52,380 That's the other one that is very important 135 00:05:52,380 --> 00:05:55,230 which is about sys admin commands. 136 00:05:55,230 --> 00:05:56,430 So what does that mean? 137 00:05:56,430 --> 00:05:58,880 That means if you see a man page 138 00:05:58,880 --> 00:06:00,960 with an eight in the header line 139 00:06:00,960 --> 00:06:03,810 that you better prepare your sudo session 140 00:06:03,810 --> 00:06:05,220 because what is documented 141 00:06:05,220 --> 00:06:09,300 in section number eight requires sudo superpowers. 142 00:06:09,300 --> 00:06:10,920 And there is section number five 143 00:06:10,920 --> 00:06:13,770 which is about file formats and conventions. 144 00:06:13,770 --> 00:06:16,290 Now, what is this file formats and conventions? 145 00:06:16,290 --> 00:06:17,880 Well, very simple. 146 00:06:17,880 --> 00:06:20,250 That's about configuration files. 147 00:06:20,250 --> 00:06:21,810 One, five, and eight. 148 00:06:21,810 --> 00:06:23,733 These are the most important ones. 149 00:06:24,750 --> 00:06:27,730 And in case you want more information about everything else 150 00:06:28,620 --> 00:06:31,080 have a look at what you see here. 151 00:06:31,080 --> 00:06:35,640 This is what is explaining how man is actually used 152 00:06:35,640 --> 00:06:39,060 and how these placeholders and the options 153 00:06:39,060 --> 00:06:43,140 and all the different alternatives are actually used. 154 00:06:43,140 --> 00:06:44,280 Let me use Q. 155 00:06:44,280 --> 00:06:45,780 Q to get out of here. 156 00:06:45,780 --> 00:06:47,040 Q for quit. 157 00:06:47,040 --> 00:06:49,950 Q for quit is a very generic Linux command 158 00:06:49,950 --> 00:06:51,510 to get out of surf. 159 00:06:51,510 --> 00:06:52,860 And let's get back to the slides 160 00:06:52,860 --> 00:06:54,450 because I have some more information 161 00:06:54,450 --> 00:06:56,253 about man on the next slide. 162 00:06:58,560 --> 00:07:00,480 So here is what is on the slide. 163 00:07:00,480 --> 00:07:02,550 So in a man page 164 00:07:02,550 --> 00:07:04,050 you will find a command summary. 165 00:07:04,050 --> 00:07:07,170 Command summary, it's showing you how to use a command. 166 00:07:07,170 --> 00:07:10,650 And we have seen the items between brackets are optional. 167 00:07:10,650 --> 00:07:13,080 And if you see curly braces, a pipe b 168 00:07:13,080 --> 00:07:14,820 you must choose and as discussed 169 00:07:14,820 --> 00:07:17,220 sometimes the curly braces are missing. 170 00:07:17,220 --> 00:07:18,810 And dot dot dot means 171 00:07:18,810 --> 00:07:21,630 that you may have more of the preceding item. 172 00:07:21,630 --> 00:07:23,070 Now we have seen in the sections. 173 00:07:23,070 --> 00:07:26,070 That we have seen that section one is for end user commands. 174 00:07:26,070 --> 00:07:27,150 Section eight is 175 00:07:27,150 --> 00:07:29,670 for administrator commands or root commands. 176 00:07:29,670 --> 00:07:32,670 Anything that requires you to type sudo in front. 177 00:07:32,670 --> 00:07:34,080 And then there is section five 178 00:07:34,080 --> 00:07:36,510 which is for configuration files. 179 00:07:36,510 --> 00:07:39,210 Many man pages have examples near the end. 180 00:07:39,210 --> 00:07:41,010 And that is pretty awesome. 181 00:07:41,010 --> 00:07:43,290 It makes working with Linux a lot easier 182 00:07:43,290 --> 00:07:46,950 especially if the command is becoming more complex. 183 00:07:46,950 --> 00:07:50,640 You will see that simple commands don't have these examples. 184 00:07:50,640 --> 00:07:52,740 More complex commands do. 185 00:07:52,740 --> 00:07:55,350 And otherwise they will have related items 186 00:07:55,350 --> 00:07:56,760 near the end as well. 187 00:07:56,760 --> 00:07:59,610 And that is convenient if you are looking for a command. 188 00:07:59,610 --> 00:08:00,660 You were in a man page 189 00:08:00,660 --> 00:08:02,730 but it's just not the right command. 190 00:08:02,730 --> 00:08:04,980 Then you will have look at the related items 191 00:08:04,980 --> 00:08:07,980 to find the actual command that you needed to use. 192 00:08:07,980 --> 00:08:09,900 In man pages you can search. 193 00:08:09,900 --> 00:08:12,870 So slash some text will search for some text. 194 00:08:12,870 --> 00:08:15,600 And you can use Q to get out of the man page. 195 00:08:15,600 --> 00:08:18,300 Before we are moving on one more small demo 196 00:08:18,300 --> 00:08:19,863 about these man pages. 197 00:08:22,890 --> 00:08:25,950 So this time I'm having a look at man LV create. 198 00:08:25,950 --> 00:08:28,080 At this point, we totally do not care 199 00:08:28,080 --> 00:08:30,640 about the LV create command. 200 00:08:30,640 --> 00:08:33,900 The thing that I want to show you here is the nice way 201 00:08:33,900 --> 00:08:36,570 how it is formatting all of its output. 202 00:08:36,570 --> 00:08:38,970 Like this highlighted line, for instance, which is 203 00:08:38,970 --> 00:08:43,290 about the command line option minus a or alternatively minus 204 00:08:43,290 --> 00:08:45,990 minus activate, and these 205 00:08:45,990 --> 00:08:48,520 or regardless which one you are using, have 206 00:08:49,734 --> 00:08:53,975 a yes, a no, or an all yes, separated by pipes again. 207 00:08:53,975 --> 00:08:56,670 So I'm using the space bar to move forward. 208 00:08:56,670 --> 00:08:57,690 And there we go. 209 00:08:57,690 --> 00:09:01,863 We have some usage examples about this lvcreate. 210 00:09:03,780 --> 00:09:05,820 Usage or examples. 211 00:09:05,820 --> 00:09:07,770 It's really basically the same. 212 00:09:07,770 --> 00:09:11,730 But lvcreate is so big a command 213 00:09:11,730 --> 00:09:15,840 that they included the separate section with the name usage. 214 00:09:15,840 --> 00:09:17,010 And look at that. 215 00:09:17,010 --> 00:09:18,960 We even have some advanced usage. 216 00:09:18,960 --> 00:09:20,370 Just giving you an impression 217 00:09:20,370 --> 00:09:22,770 of how rich this environment is. 218 00:09:22,770 --> 00:09:25,560 And there we go, the examples. 219 00:09:25,560 --> 00:09:27,060 Examples is what you find 220 00:09:27,060 --> 00:09:29,910 in more complex man pages. 221 00:09:29,910 --> 00:09:32,310 And if you go further, what else do we have? 222 00:09:32,310 --> 00:09:33,810 We have see also. 223 00:09:33,810 --> 00:09:37,650 If lvcreate happens to be not exactly what you need 224 00:09:37,650 --> 00:09:41,760 then see also is giving an overview of related commands. 225 00:09:41,760 --> 00:09:44,640 You might find what you need right in there. 226 00:09:44,640 --> 00:09:47,490 Okay, now I'm going to use the G key. 227 00:09:47,490 --> 00:09:51,330 G for go all the way to the top, because I want to show you 228 00:09:51,330 --> 00:09:53,130 and look at the lower left corner. 229 00:09:53,130 --> 00:09:54,930 I want to show you how you can search 230 00:09:54,930 --> 00:09:56,580 for text in a man page. 231 00:09:56,580 --> 00:09:58,770 So I'm using slash write, which will search 232 00:09:58,770 --> 00:10:01,080 for the text write in the man page. 233 00:10:01,080 --> 00:10:02,550 And there you see, 234 00:10:02,550 --> 00:10:05,670 that the first occurrence of the word is highlighted. 235 00:10:05,670 --> 00:10:07,470 If you need to see the next press N 236 00:10:07,470 --> 00:10:11,700 and N and N until you found what you were looking for 237 00:10:11,700 --> 00:10:15,240 and once you are ready press Q to get out of here. 238 00:10:15,240 --> 00:10:17,550 That's how you use man. 239 00:10:17,550 --> 00:10:19,503 Let's continue with the next topic.