1 00:00:00,420 --> 00:00:01,980 Hello, the beautiful people. 2 00:00:01,980 --> 00:00:05,790 Knowing the last video you learned about the structure of the Linux manual and you saw the way that 3 00:00:05,790 --> 00:00:10,650 it was broken up into eight sections and those eight sections each deal with a different part of the 4 00:00:10,650 --> 00:00:11,830 Linux experience. 5 00:00:11,850 --> 00:00:15,360 Now we're going to take that theory from the last video and we're going to turn it into practice in 6 00:00:15,360 --> 00:00:15,990 this video. 7 00:00:15,990 --> 00:00:20,280 So in this video, you're going to learn how to search the manual and discover new commands. 8 00:00:20,280 --> 00:00:24,690 You can learn how to access the manual pages for those commands, and you're also going to learn how 9 00:00:24,690 --> 00:00:30,210 to read them so that you can go out there and independently learn how to use new stuff. 10 00:00:30,210 --> 00:00:33,870 So by the end of this video, you'll have the independence to search for new commands and learn about 11 00:00:33,870 --> 00:00:34,530 how they work. 12 00:00:34,530 --> 00:00:38,550 And this is going to put you in the driver's seat because it makes it possible for you to gain more 13 00:00:38,550 --> 00:00:42,840 control over your Linux system because you can start learning independently about how everything works 14 00:00:42,840 --> 00:00:48,330 rather than waiting for random changes that you randomly bump into learning new commands. 15 00:00:48,330 --> 00:00:52,350 So you can take a lot more of an active role in your learning and your development of the Linux operating 16 00:00:52,350 --> 00:00:52,800 system. 17 00:00:52,800 --> 00:00:55,320 So let's go ahead and get right into it. 18 00:00:57,370 --> 00:00:57,740 Okay. 19 00:00:57,760 --> 00:01:02,410 So now that you know that the manual is broken up into eight sections, how would you know what section 20 00:01:02,410 --> 00:01:04,239 to look in to find what you're looking for? 21 00:01:04,330 --> 00:01:08,530 Well, let's say that you wanted to look up information about the Witch Command. 22 00:01:08,530 --> 00:01:13,130 First to search the manual, you would have to use the man command. 23 00:01:13,150 --> 00:01:18,130 Now, the man command is short for the word manual, and it's the command that deals with everything 24 00:01:18,130 --> 00:01:19,720 to do with the manual, basically. 25 00:01:20,170 --> 00:01:24,700 And this is why they're actually called man pages, because it's the man command that looks through 26 00:01:24,700 --> 00:01:25,300 the manual. 27 00:01:25,780 --> 00:01:27,460 Now, that's the command name. 28 00:01:27,460 --> 00:01:28,300 So we're good at that. 29 00:01:28,300 --> 00:01:30,790 Now we need to give it any options if necessary. 30 00:01:30,910 --> 00:01:34,590 We're actually going to use the Kay option, which is what deals with searching. 31 00:01:34,960 --> 00:01:36,760 So we've got command name, then options. 32 00:01:36,760 --> 00:01:41,080 Now it needs an input and the input that we're going to give it is the search term. 33 00:01:41,080 --> 00:01:46,360 So we type which so we've got a command name, we've got our options, we've got our inputs. 34 00:01:46,360 --> 00:01:48,790 The same general structure that I was telling you about before. 35 00:01:49,930 --> 00:01:55,270 But now what we're doing actually is we're using the man command to search the manual for this search 36 00:01:55,270 --> 00:01:57,250 term, this search term here called which. 37 00:01:57,700 --> 00:02:01,120 And it's going to look all the way through the manual and find anything that might be relevant to that 38 00:02:01,120 --> 00:02:01,570 search term. 39 00:02:01,570 --> 00:02:04,060 It's like your own mini search engine for your manual. 40 00:02:04,060 --> 00:02:08,560 So if I press enter, we get quite a few lines of output here. 41 00:02:08,860 --> 00:02:12,370 So let's let's have a look at what this is on the left here. 42 00:02:12,370 --> 00:02:15,970 You're going to get the names of certain manual pages. 43 00:02:16,240 --> 00:02:20,520 So every single one of these is a manual page that is appropriate to this search term. 44 00:02:21,220 --> 00:02:27,790 And on the right, you get a bit of a synopsis about that actual page so you can pick which one might 45 00:02:27,790 --> 00:02:29,410 be most appropriate. 46 00:02:30,910 --> 00:02:36,910 And the other thing is in the parentheses here, you get the section number of the manual that that 47 00:02:36,910 --> 00:02:38,020 page is in. 48 00:02:38,020 --> 00:02:44,230 So, for example, this command, this this manual page is in the first section of the manual, which 49 00:02:44,230 --> 00:02:49,330 means it's a user command, whereas this one is in the eighth section of the manual, which means that 50 00:02:49,330 --> 00:02:52,270 it is a more system, administrative kind of thing. 51 00:02:52,270 --> 00:03:00,340 And this one is a in section five, which is going to be about file, file configuration, how the files 52 00:03:00,340 --> 00:03:03,000 are structured and things like that, information about how files are structured. 53 00:03:03,010 --> 00:03:04,330 So there we go. 54 00:03:04,330 --> 00:03:08,440 We can actually see at a glance whether it actually suits our needs or not. 55 00:03:08,440 --> 00:03:12,820 And if we decide that we want to take a further look, it seems like this one is exactly what we're 56 00:03:12,820 --> 00:03:13,180 looking for. 57 00:03:13,180 --> 00:03:16,780 It's in the user command section and it's a command that locates a command. 58 00:03:18,070 --> 00:03:24,190 We can actually take a deeper look at that by using the main command again, then the section number. 59 00:03:24,190 --> 00:03:28,330 So the section number is one and then we type the search term. 60 00:03:28,330 --> 00:03:31,990 Oh, sorry, the page name which is on the left there, which is which. 61 00:03:32,200 --> 00:03:37,600 And if I press enter Dada, we've opened up the manual page for the Witch Command. 62 00:03:37,600 --> 00:03:41,320 Now it's only very small and once we've opened that to close it and get back out, we just press the 63 00:03:41,320 --> 00:03:43,810 Q key on the, on the keyboard. 64 00:03:43,810 --> 00:03:47,830 So I press the letter Q and I'm back out on my command line. 65 00:03:47,830 --> 00:03:54,340 So, for example, we could open up this soul section here, this soul thing by doing Man six because 66 00:03:54,340 --> 00:03:55,390 it's section six. 67 00:03:55,480 --> 00:04:01,900 So and I press enter and it opens up that, that manual page for soul, which you can see at the top 68 00:04:01,900 --> 00:04:09,760 right there now because the first section of the manual is used so often, you don't usually have to 69 00:04:09,760 --> 00:04:11,080 type the number one. 70 00:04:11,080 --> 00:04:16,060 Even so, instead of typing man one which as a nice shortcut, I can just type the word man, I can 71 00:04:16,060 --> 00:04:20,769 just type man which, which will open up the same page, the same manual page. 72 00:04:20,769 --> 00:04:23,800 And you can see that it is indeed in section one. 73 00:04:24,220 --> 00:04:25,510 So that's a shortcut. 74 00:04:25,510 --> 00:04:30,010 If you see that something is in Section one, you don't need to type the one, you just type the actual 75 00:04:30,010 --> 00:04:30,880 name of the page. 76 00:04:30,880 --> 00:04:32,800 So like up here we've got LCF, right? 77 00:04:32,800 --> 00:04:40,600 LCF is in section one I type man LCF and we see that we are now in the LCF man page in section one, 78 00:04:40,600 --> 00:04:42,520 which means that it's a user command. 79 00:04:42,880 --> 00:04:45,940 So that's how you would open up a manual page. 80 00:04:45,940 --> 00:04:49,870 And up next now we're going to take a look at how you would actually read it. 81 00:04:50,200 --> 00:04:50,440 Okay. 82 00:04:50,560 --> 00:04:53,380 So let's take a look at the man page for the Witch Command. 83 00:04:53,380 --> 00:04:57,580 So I'm just going to type man and then which and because it's actually a command that I've used very 84 00:04:57,580 --> 00:05:01,750 recently, I could have just pressed the up arrow key a couple of times and I get back to the same result. 85 00:05:02,110 --> 00:05:06,010 So I press man which press enter and we've opened up the manual page. 86 00:05:06,010 --> 00:05:11,020 Now we can see that this manual page is actually broken up into the following sections at the top. 87 00:05:11,020 --> 00:05:18,580 We've got name, then we've got synopsis, then we've got description, then we've got options, then 88 00:05:18,580 --> 00:05:20,020 we've got exit status. 89 00:05:20,020 --> 00:05:27,010 Okay, now other sections that a man page may include are examples, a C, also section and environment 90 00:05:27,010 --> 00:05:27,760 section. 91 00:05:27,760 --> 00:05:35,020 Things about bugs, things about authors, things about reporting bugs, history of the command, copyright 92 00:05:35,020 --> 00:05:36,340 things, stuff like that. 93 00:05:36,580 --> 00:05:39,490 But this is what we get in this specific manual page. 94 00:05:39,640 --> 00:05:44,230 So they're not always structured the same way, but they usually follow this kind of structure. 95 00:05:44,230 --> 00:05:49,450 Okay, now in the name section, we see that we are dealing with the Witch Command and we see a little 96 00:05:49,450 --> 00:05:50,560 bit about what it does. 97 00:05:50,560 --> 00:05:54,430 And this bit is actually what came up when we searched the manual in the first place. 98 00:05:54,670 --> 00:05:55,690 This is exactly what came up. 99 00:05:55,690 --> 00:05:56,560 We saw the name and then we. 100 00:05:56,660 --> 00:05:59,960 Had this little piece of information on the right hand side. 101 00:06:01,430 --> 00:06:07,250 Um, now in the description section, this is where you, this is where you really see what the command 102 00:06:07,250 --> 00:06:07,520 does. 103 00:06:07,520 --> 00:06:11,720 And the description section is a very important section, and it gives you a much more in-depth description 104 00:06:11,720 --> 00:06:13,600 of what the command actually does. 105 00:06:13,610 --> 00:06:18,170 This is likely going to be one of the most useful parts of the main page for any command, and as it 106 00:06:18,170 --> 00:06:21,020 will try to explain what the command does in plain English. 107 00:06:21,290 --> 00:06:26,510 Okay, so you've got the which command description there and up here you've got the in the synopsis 108 00:06:26,510 --> 00:06:31,670 section, we can see a layout of how to actually use the command. 109 00:06:31,700 --> 00:06:32,720 A Ha. 110 00:06:32,720 --> 00:06:36,740 So you remember when I was telling you that each command is structured differently and you need to read 111 00:06:36,740 --> 00:06:39,050 the manual pages to see how to use a command? 112 00:06:39,050 --> 00:06:44,060 Well, this is the section of the manual page that will tell you how to use the command, the synopsis 113 00:06:44,060 --> 00:06:44,720 section. 114 00:06:44,720 --> 00:06:50,900 So for the Witch Command, we can see that first we type which the command name and then we see the 115 00:06:50,900 --> 00:06:58,100 a option in some square brackets which we'll come onto in a minute and then some kind of file name and 116 00:06:58,100 --> 00:07:02,210 then three dots or other also known as an ellipsis afterwards. 117 00:07:02,210 --> 00:07:03,830 So let me explain what this stuff means. 118 00:07:04,070 --> 00:07:11,900 So first we enter the which command name we just type, which then we have the a option which is optional. 119 00:07:11,900 --> 00:07:17,360 Now we know it's optional because it's inside these square brackets in a man page. 120 00:07:17,360 --> 00:07:21,350 If something is inside square brackets, that means it's optional. 121 00:07:21,620 --> 00:07:23,840 You don't have to enter it, but you can. 122 00:07:24,410 --> 00:07:31,520 Now, next after that, once we've entered our optional option, we next you have to enter the name 123 00:07:31,520 --> 00:07:34,190 of a command that you're actually looking for. 124 00:07:34,190 --> 00:07:37,010 Now you can see so so you enter a name of what you're looking for. 125 00:07:37,010 --> 00:07:40,790 So for example, which may be Dash A and then echo. 126 00:07:40,830 --> 00:07:43,070 Okay, that would show you where the Echo command was. 127 00:07:43,070 --> 00:07:46,700 But you also see this ellipsis or these three dots. 128 00:07:46,730 --> 00:07:50,480 Now, these three dots mean that you can enter more than one file name. 129 00:07:50,480 --> 00:07:54,440 So in other words, the which command can take more than one input? 130 00:07:55,160 --> 00:07:55,580 Ha. 131 00:07:55,580 --> 00:07:57,230 Things are starting to fall into place now. 132 00:07:57,250 --> 00:07:57,530 Right? 133 00:07:57,530 --> 00:07:59,480 So how do you know how many inputs a command takes? 134 00:07:59,480 --> 00:08:00,440 Will you look at the man page? 135 00:08:00,440 --> 00:08:03,620 You look at the synopsis, and it will tell you how many inputs it takes. 136 00:08:03,620 --> 00:08:04,090 Okay. 137 00:08:04,130 --> 00:08:05,390 Now, just to prove it. 138 00:08:05,390 --> 00:08:08,570 Okay, just to prove this, we're going to take what we've learned here and we're going to apply it. 139 00:08:08,570 --> 00:08:08,780 Okay. 140 00:08:08,840 --> 00:08:12,500 So I'm going to go back I'm going to clear the screen press by holding control now. 141 00:08:12,530 --> 00:08:18,080 And we're going to see we're going to try and use the which command to find the date command and the 142 00:08:18,290 --> 00:08:19,610 command at the same time. 143 00:08:20,360 --> 00:08:21,770 So we've used the which command. 144 00:08:21,800 --> 00:08:26,300 We didn't give it the a option, but we didn't have to because it's just option, just optional because 145 00:08:26,300 --> 00:08:30,500 we because it was in the square brackets and we've given it a one file name and then another file name. 146 00:08:31,040 --> 00:08:36,980 So if we press enter Dada, we see that we get two outputs and that it's found the locations of the 147 00:08:36,980 --> 00:08:39,200 date command and then the Cal Command. 148 00:08:39,200 --> 00:08:44,750 We didn't need to run the command twice because if we look at the main page, it tells us we can actually 149 00:08:44,750 --> 00:08:47,330 give it more than one file name. 150 00:08:47,660 --> 00:08:49,100 So that's really, really useful. 151 00:08:49,100 --> 00:08:49,940 And maybe not. 152 00:08:49,940 --> 00:08:53,180 Maybe something we wouldn't have known had to do if we had not looked at the main page. 153 00:08:53,300 --> 00:08:57,980 And as I said, the things inside square brackets in the main page, let me open up again. 154 00:08:58,820 --> 00:09:01,370 Things inside the square brackets are optional. 155 00:09:01,820 --> 00:09:04,370 This kind of stuff you don't have to have, but you can have. 156 00:09:04,370 --> 00:09:07,250 And if you want to know what it does, you just go to the options section. 157 00:09:07,250 --> 00:09:12,200 So if I put in the A option, it says it'll print all matching path names of each argument. 158 00:09:12,200 --> 00:09:13,610 So all matching path names. 159 00:09:13,610 --> 00:09:14,990 So A is short for all. 160 00:09:14,990 --> 00:09:23,540 So what I could do is I could type, which I could do which date and cow, but I could type dash a and 161 00:09:23,540 --> 00:09:24,680 see if that does any difference. 162 00:09:24,680 --> 00:09:31,610 It actually it doesn't make any difference, but it will show us all of the different all of the different 163 00:09:31,610 --> 00:09:32,240 results. 164 00:09:32,240 --> 00:09:37,700 So maybe, you know, when I told you about searching from searching on the path, maybe this would 165 00:09:37,700 --> 00:09:41,210 allow us to look in folders that were later on in the path if they had the same name as where they were 166 00:09:41,210 --> 00:09:41,960 earlier on. 167 00:09:42,440 --> 00:09:44,120 So there we go. 168 00:09:44,120 --> 00:09:47,750 Now there's other symbols in the manual pages, such as angle brackets. 169 00:09:47,750 --> 00:09:49,640 So these kind of things, right? 170 00:09:49,640 --> 00:09:56,390 So if you have something inside here inside a manual page, so if we had like which and then it was 171 00:09:56,390 --> 00:10:03,350 like this and then you had something inside angle brackets, anything inside the angle brackets is mandatory. 172 00:10:03,350 --> 00:10:05,090 That means you have to have it. 173 00:10:05,300 --> 00:10:05,620 Okay. 174 00:10:05,720 --> 00:10:09,170 So if you see something inside angle brackets, that means you have to have it and you can't miss it 175 00:10:09,170 --> 00:10:09,650 out. 176 00:10:09,680 --> 00:10:10,220 All right. 177 00:10:10,940 --> 00:10:12,110 So just bear that in mind. 178 00:10:12,110 --> 00:10:14,360 There's also the pipe character. 179 00:10:14,360 --> 00:10:21,350 So if I had an option here and it was something like, say, you had the F option because there's a 180 00:10:21,350 --> 00:10:29,330 pipe character between the two options, that means that you have to pick one or the other. 181 00:10:29,750 --> 00:10:32,090 Okay, so the pipe means one or the other. 182 00:10:32,090 --> 00:10:33,560 You cannot have both. 183 00:10:33,560 --> 00:10:41,570 So I couldn't type I couldn't type a which which does a f date. 184 00:10:42,140 --> 00:10:45,860 I would have to type which dash A or which does F. 185 00:10:46,130 --> 00:10:47,150 I couldn't have both. 186 00:10:47,240 --> 00:10:51,800 That's what happens if you see something inside inside angle brackets. 187 00:10:52,130 --> 00:10:56,480 So I'm just going to type my finger again, angle brackets with a pipe in between them. 188 00:10:56,750 --> 00:10:57,200 Okay. 189 00:10:57,980 --> 00:10:59,150 So what we're doing so far. 190 00:11:00,900 --> 00:11:01,280 Okay. 191 00:11:02,120 --> 00:11:04,070 It's probably what you'll come up with most of the time. 192 00:11:04,670 --> 00:11:06,500 So these are all the different things that you'll see. 193 00:11:06,500 --> 00:11:07,790 You'll have the command name. 194 00:11:07,880 --> 00:11:09,350 You have some options. 195 00:11:09,560 --> 00:11:14,780 It'll tell you which ones are optional and which ones you need and which ones cannot be combined with 196 00:11:14,780 --> 00:11:15,350 others. 197 00:11:15,890 --> 00:11:18,370 You'll see things that maybe are mandatory inside square brackets. 198 00:11:18,390 --> 00:11:21,590 Anything with a dot, dot, dot after it means you can have more than one thing. 199 00:11:21,590 --> 00:11:23,810 So if it had like this, it was file name, wasn't it? 200 00:11:23,810 --> 00:11:28,310 And then dot, dot, dot, that means you can have more than one file name when you use this command. 201 00:11:28,340 --> 00:11:32,510 Now I'm actually going to put a PDF in the resource in the resource section for this lecture that lists 202 00:11:32,510 --> 00:11:33,950 out what the different symbols mean. 203 00:11:33,950 --> 00:11:36,800 So you can use it if you ever need a quick refresher. 204 00:11:36,800 --> 00:11:38,360 But that's pretty much all you need to remember. 205 00:11:38,360 --> 00:11:38,660 Okay. 206 00:11:38,690 --> 00:11:41,660 Just the anything in square brackets is optional. 207 00:11:41,930 --> 00:11:45,230 Anything with a pipe in between it, you can only have one or the other. 208 00:11:45,290 --> 00:11:48,530 Anything in square, anything in brackets is mandatory. 209 00:11:48,530 --> 00:11:51,800 And I think with dot, dot, dot after it, you can use more than once because that's pretty much all 210 00:11:51,800 --> 00:11:52,400 you need to know. 211 00:11:52,400 --> 00:11:56,540 And if you want to know how to look up what different options do, just scroll down to the options section 212 00:11:56,540 --> 00:11:58,910 in the main page and it'll tell you exactly how to use them all. 213 00:11:59,480 --> 00:12:00,320 Okay, awesome. 214 00:12:00,320 --> 00:12:04,490 So we've covered a whole lot of stuff in this video and you should start feeling a lot more comfortable 215 00:12:04,490 --> 00:12:05,480 using the command line. 216 00:12:05,480 --> 00:12:11,660 Already in this video, you saw how to search the manual using the man command with the K option, and 217 00:12:11,660 --> 00:12:16,520 after that you can give it any search term that you want and the man command will search the manual 218 00:12:16,520 --> 00:12:22,310 for that search term and give you a list of results as well as what those results are and where section 219 00:12:22,310 --> 00:12:23,590 of the manual page they're in. 220 00:12:23,600 --> 00:12:30,950 You saw how to access those specific manual pages and also how to read them for specific command structure. 221 00:12:30,950 --> 00:12:37,580 So we saw how how to actually use the which command using its manual page and we saw the different symbols 222 00:12:37,580 --> 00:12:40,220 that might come up in the manual page and tell you how to use it. 223 00:12:40,220 --> 00:12:44,780 But I've attached to cheat sheet in the resources section for this video that I massively encourage 224 00:12:44,780 --> 00:12:48,830 you to use and keep on hand, because it's going to give you an explanation of each of the different 225 00:12:48,830 --> 00:12:53,810 symbols that might show up in a manual page so that you can keep that to hand and make sure that you 226 00:12:53,810 --> 00:12:56,990 don't forget anything but to ensure that you don't forget anything. 227 00:12:57,020 --> 00:12:58,940 Up next, we're going to have some practice. 228 00:12:58,940 --> 00:13:02,030 What we're going to do is we're going to go together and we're going to look at we're going to search 229 00:13:02,030 --> 00:13:05,480 for a new command and we're going to read about how it works. 230 00:13:05,480 --> 00:13:09,440 We're going to look at its manual page, and we're going to take that learning and actually apply it 231 00:13:09,440 --> 00:13:14,810 and show you how the how you would take a man page that you've never seen before and learn how to use 232 00:13:14,810 --> 00:13:14,900 it. 233 00:13:14,900 --> 00:13:19,280 So we're going to be applying what we've learned in this lecture about reading manual pages and apply 234 00:13:19,280 --> 00:13:21,800 it to a completely new command and go through it together. 235 00:13:21,800 --> 00:13:26,420 And after that, you should definitely feel as though, hey, any command or any manual page that I 236 00:13:26,420 --> 00:13:30,440 come up against, I'll know how to read and know how to use, which is going to give you a massive boost 237 00:13:30,440 --> 00:13:35,030 of confidence and a massive boost of independence for you to explore and learn more about the Linux 238 00:13:35,030 --> 00:13:35,870 operating system. 239 00:13:35,870 --> 00:13:39,920 So let's go ahead and jump into the next video and get some super, super cool practice.