1 00:00:06,660 --> 00:00:10,009 We have just seen that behind the command you can type help to get help. 2 00:00:11,849 --> 00:00:14,550 There is a better way to get help, and that is man. 3 00:00:15,929 --> 00:00:20,469 Now why should you use man? Well, MAN is specific to the system on which you are using it. 4 00:00:21,429 --> 00:00:24,750 And that means that the information that MAN is showing is accurate. 5 00:00:26,000 --> 00:00:29,300 MAN is also the only way to get help on a disconnected system. 6 00:00:30,280 --> 00:00:36,369 You know, it has happened to me that I was working on a Linux system somewhere deep down in the data center. 7 00:00:36,890 --> 00:00:42,469 There were three layers of security between the front door and the server I needed to work on. 8 00:00:43,030 --> 00:00:47,615 And guess what? Apart from the system itself, I couldn't use my cell phone to 9 00:00:47,615 --> 00:00:52,200 go online and to google for information. Well then it's convenient that there is man. 10 00:00:52,939 --> 00:00:59,149 And also that is true if your system is disconnected, man doesn't hallucinate. 11 00:00:59,810 --> 00:01:05,180 I know you may have used ChatGPT or other gen AI utilities to get information. 12 00:01:05,879 --> 00:01:09,829 And even if that information often is pretty accurate, sometimes it's not. 13 00:01:10,390 --> 00:01:17,079 And the AI solution is hallucinating. It's just making up some information that's not really true. 14 00:01:18,590 --> 00:01:22,159 Also, if ever you are going to prepare for one of the 15 00:01:22,159 --> 00:01:25,729 Linux exams, you won't have Internet access, you will have man. 16 00:01:26,530 --> 00:01:31,329 So if you are planning to take Linux plus or RHCSA 17 00:01:31,329 --> 00:01:36,129 or lfcs, you won't have Internet access, you will have man. 18 00:01:37,890 --> 00:01:40,450 MAN stands for the System Programmer's Manual. 19 00:01:43,090 --> 00:01:47,489 It is the main, but not the only source for getting information about Linux command usage. 20 00:01:49,030 --> 00:01:53,969 I recommend you use MAN to get information about commands, configuration files and more. 21 00:01:55,390 --> 00:02:00,659 Now in MAN pages you have sections and there's a couple of sections you need to know about. 22 00:02:01,260 --> 00:02:04,010 Which is section one that is for end user commands. 23 00:02:05,010 --> 00:02:10,969 Section eight is for administrator commands, these are commands that require root privileges. 24 00:02:11,909 --> 00:02:14,469 And section 5 is for configuration files. 25 00:02:16,129 --> 00:02:19,030 In a MAN page you will always have a couple of common elements. 26 00:02:20,129 --> 00:02:23,509 There is the command summary which will show you how to use a command. 27 00:02:24,240 --> 00:02:27,060 In this command summary you can see items between brackets. 28 00:02:27,599 --> 00:02:33,310 If an item is listed between brackets, that means that it is optional. You may use it. You don't have to use it. 29 00:02:34,590 --> 00:02:41,490 If you see curly braces in a pipe B, then it means that you must choose between either A or B. 30 00:02:43,569 --> 00:02:49,490 You might also see that means that you may have more of the preceding item. 31 00:02:50,490 --> 00:02:56,460 Bold or uppercase is used for placeholders, so you can use the word file in 32 00:02:56,460 --> 00:03:02,430 uppercase. And it means that the command expects you to specify a file name. 33 00:03:04,090 --> 00:03:10,229 Pretty often MAN pages have usage examples near the end and that is useful if you have a complex command. 34 00:03:11,080 --> 00:03:15,699 If the Command is not complex, then you might not find these 35 00:03:15,699 --> 00:03:20,319 usage examples, but you will always find related items to the end. 36 00:03:21,719 --> 00:03:26,290 Now as a man page can be pretty big. Within the man page you can search 37 00:03:26,290 --> 00:03:30,860 use slash followed by some text to search within the man page for some text. 38 00:03:31,939 --> 00:03:36,139 If you are done with it and you need to get out, Q is the command to get out. 39 00:03:36,800 --> 00:03:38,139 Let me show you how to use man. 40 00:03:39,860 --> 00:03:41,240 Let's start with man ls. 41 00:03:42,400 --> 00:03:47,805 Then what do we see? Well, there's a funny thing on the header line you can see LS 42 00:03:47,805 --> 00:03:53,210 followed by A1. But do you notice LS is in uppercase in case you want to know why. 43 00:03:53,810 --> 00:03:56,159 Well, there's a funny explanation for it. 44 00:03:56,680 --> 00:03:58,699 Out of respect for history. 45 00:03:59,719 --> 00:04:03,639 That is the very first man pages that were created 46 00:04:03,639 --> 00:04:07,560 in the early 1970s were created on a typewriter. 47 00:04:08,270 --> 00:04:12,745 In those days if you had a multi page document that you created on a typewriter, you 48 00:04:12,745 --> 00:04:17,220 would create a header line. And in the header line you would normally type the subject. 49 00:04:17,800 --> 00:04:22,670 And to distinguish it from the rest of the text, this subject was written in uppercase. 50 00:04:24,230 --> 00:04:30,730 Now out of respect for history, man pages still have the command always listed in uppercase in the header line. 51 00:04:31,670 --> 00:04:35,089 But the real way how you use the command is in the name right here. 52 00:04:35,709 --> 00:04:42,009 This name has a command and a short description of the command. So LS is for list, directory contents. 53 00:04:43,069 --> 00:04:46,870 And then we have the synopsis where LS can be used by options. 54 00:04:48,050 --> 00:04:53,909 The word option is a placeholder, so you need to replace it with any option that you might like to 55 00:04:53,909 --> 00:04:59,769 use and it's between square brackets and that means that you may use an option, you don't have to. 56 00:05:00,689 --> 00:05:06,129 We also see behind the option and it means that you are allowed to put more than one option. 57 00:05:06,860 --> 00:05:09,379 And likewise for file, which is also a placeholder. 58 00:05:10,759 --> 00:05:15,430 Then you have a list of all the options with an explanation of the option 59 00:05:15,430 --> 00:05:20,100 and use the spacebar to scroll down to get to the end of it. 60 00:05:21,300 --> 00:05:24,825 Now, related command. Look at that, the 61 00:05:24,825 --> 00:05:28,350 related command. We see also their colors. 62 00:05:28,949 --> 00:05:34,620 So their colors in section one is a man page that obviously is about directory colors. 63 00:05:36,279 --> 00:05:41,559 Also we see for full documentation about men, you can access 64 00:05:41,559 --> 00:05:46,839 it through this URL or locally using the info command. 65 00:05:48,220 --> 00:05:51,950 I really don't like the info command and honestly I never use it. 66 00:05:51,950 --> 00:05:55,680 But let me give you a quick look at this info command. 67 00:05:56,939 --> 00:06:01,939 Now let me paste the command and there we can see how this info looks like. 68 00:06:02,680 --> 00:06:04,459 This is like a prehistoric webpage. 69 00:06:05,139 --> 00:06:06,920 And that's what I don't like about it. 70 00:06:07,600 --> 00:06:13,443 But there's a lot of text, a lot of explanation, and there are also items that are listed 71 00:06:13,443 --> 00:06:19,286 with an asterisk. These items are menu items, and if you want to get more information about the 72 00:06:19,286 --> 00:06:25,129 menu items, select either one of them and then you press Enter to go deeper in the menu. 73 00:06:26,050 --> 00:06:31,939 And if you want to go up, you press U for up and if you have seen enough, you you press Q to quit. 74 00:06:33,000 --> 00:06:38,215 Info is confusing Good news about Info is that you will be able to work with Linux 75 00:06:38,215 --> 00:06:43,430 even if you don't know how to use info. It's not an essential way to get help.