 The decision over whether or not to use the terminal is of course a choice that you need to make on your own, but I've talked many times over the course of the last three years over the merits of actually learning how to use the terminal. Even if you're just going to learn the basics, I've always said it's better to learn a few things on the terminal than to learn nothing at all because eventually on Linux you're going to come across something that you have to do in the terminal or that it's at least easier to do in the terminal and knowing just a little bit can get you a long way. One of the questions that I get most often when people talk about the terminal is how do I learn? Where are the best resources for me to learn from? What are those resources? How do I find them? What's the best way of learning something when it comes to the terminal? All these questions mostly centering around the fact that when it comes to anything on Linux there's multiple ways of doing something and when that's true and it's almost always true on the Linux side of things. Anyone who writes a tutorial on this kind of stuff does it in a slightly different way. You can get on Google and search how do I do whatever and you're going to find six different ways of doing it. What do you consider the best way? It's really hard for a new user or even someone who's just never used the terminal before but has used Linux for a long time. It's hard for anyone to decipher what's the best way of doing anything. What's the best source of material for me to learn from? There is actually a thing that you should use or some group of things that you should use to get that information and those are man pages. Now man pages have been around for a very very long time and I forget constantly that they exist. It's a stupid thing to forget about because like I said they've been around for a long time and they're essential when it comes to learning anything in the terminal but I forget about them a lot because I don't use them as often as I should so that's a personal failing on my part and I would suggest that you don't make the same mistake because man pages are awesome. They're amazing. I'm going to show you today the amount of information you can get when it comes to man pages. Now before I jump in and show you what a man page is, how you navigate them and all this stuff I do want to say that man pages just like documentation everywhere varies in quality. So you're going to find some programs slash commands on the terminal that have man pages that are really really good. A good example of this is Vim. Vim's man pages are really really good. Same with Bash. The Bash man pages fantastic. Then you're going to find some applications slash commands on the terminal that have man pages that are awful that are really bad. Maybe they're five or six lines or maybe it's a really simple command but it has you know 50,000 words. You know you'll find both situations well a lot of situations like that when it comes to man pages simply because the man pages are written by the developers and the amount of effort they put into them is going to vary. Some developers consider it a very essential part of their program to provide you documentation inside of the man page. Some developers don't want to do a man page at all. So they just do a simple one and put all their documentation everywhere or elsewhere I should say. And some developers put all of their documentation inside of man pages and then don't put it anywhere else. I'm looking at UBS PWM. Anyway, so the quality of man pages will vary and you'll find yourself disappointed sometimes and very mightily impressed sometimes. It's really kind of luck of the draw. Unfortunately, there's no consistency across developers. It's just the way it kind of is. So let's go ahead and jump in and I'll show you a few man pages and we'll talk about them. Okay, so the best place to view a man page is in the terminal. Now it doesn't mean that that's the only place of course you can usually find man pages on the internet somewhere for whatever command or program you're looking for if you prefer to look at the man page in a browser but if you've installed the application, the man page is almost certainly have been included in the install somewhere on your system. And the best way to access that man page is with the man command. Now you can find a man page for basically any program that you've installed or that is installed in your system. So for example, man CD does exist. It's just these few lines. There's not anything more to the man for CD. All that stuff is here. Now the reason why I know that this is all there is for the CD command is because I had this idea for a video. Five secret ways you can use the CD command. Turns out there's nothing more you can do with a CD command other than change directories. That's all you can do. There's no extraneous like flags or anything for CD. So the man page is obviously therefore not all that complicated. There's 32 lines here. That's literally all there is. Now when you're inside of a man page, the best way to get out of a man page is to press the Q button. That's the best way to do it. It's very simple. And if you ever forget that, usually along the bottom here, it will say type Q to quit. If you need to figure out any of the other commands or key bindings that you can use while inside of a man page, you can use the H command. That'll show you all of the key bindings for less, which is the viewer that you're using when you use a man page. So just hit Q, hit Q again, we'll quit that. Now let's take a look at a more complex man page. So I'm gonna do man kitty, which is the terminal that I'm using. And this one here has a whole bunch more lines to it. There's obviously a whole bunch of documentation here for you to go through if you wanted to learn about kitty. The best way to move between lines and pages inside of a man page is to use the VIM keys. So J goes down, H goes up. So if you've ever used VIM before, you'll be perfectly well at home moving around a man page. You can also use the slash key to search for if I wanted to search for config, I can do that. And then I can just use the N, the letter N to go back and forth between different entries in that search. So most of the VIM movements here work just fine inside of less, which is again, the viewer that you use when you're viewing a man page. So the benefits obviously to a man page is that it gives you information over how to use the command or the terminal application. So the biggest reason why you'd wanna use this, especially is if you're going to look for options that the command or the application have. So in the case of kitty here, if I say I wanted to use a specific kitty configuration file to test it or whatever, I could use the dash dash config flag when I run kitty from the terminal. Now, obviously you're not usually going to run kitty from the terminal, but you can. This dash dash config option allows me to specify a path to the configuration files that I wanna use. And it tells me all the information that I could possibly want about this specific flag. Same thing about setting a custom class for kitty, I could do that. Or, and this is useful, not if I just wanted to launch kitty from the terminal, but also if I wanted to have a key binding inside of say a configuration file for Qtile or I3 or SXHKD or whatever. And I wanted to have a specific instance of kitty with a specific class name. Obviously I would not know this existed unless I came to the man page and learned what that is. So all of the information you want for a particular program is going to be located inside of the man page if it has one. Now that's a big proviso because there are some applications that don't have man pages. Either the developer decided that they didn't wanna create one or they just decided to put all their documentation online somewhere, whatever. But some applications you'll come across don't have man pages and that always makes me a bit sad because as you can see in the case of kitty, it can be very, very useful because it gives you options over how to use it. It gives you examples. So we can take a look at another one. So Qtiquit will do man bash. This is the man page for bash. Now if you're going to learn how to script in bash, I highly recommend you come here and read this man page. And I also will tell you this right up front. It's gonna take you a while because this is a very, very long man page. If we wanted to scroll up here from the bottom, we'd be scrolling for quite some time. In fact, I don't think we could probably do it all in this video because it's very, very, very, very long. And it tells you a lot of stuff if you'd need to know how to not only use bash, how to script bash, but how to use some bash commands instead of the terminal. Another really cool thing about man pages is that oftentimes, not all the information you need is inside of this singular man page. Sometimes you have other man pages. So if I show you the man page for Paru, which is an AUR helper, and if we go to the bottom, we can actually see a place here that says see also this line right here. So if you enter into a man page and not all the information you expect to be there is actually there, jump to the bottom and see if it has a section that looks like this. Because for example, the Paru man page just tells you how to use the command. It doesn't tell you how to configure Paru. So I always wondered where are all the documentations for how to do the configuration? Well, it's in its own configuration file. So if you see this, this is what the Paru man page looks like. If I do man paru.conf, which I found from looking at that see also section, this is the man page for the configuration file. And there were all, there were other ones as well. So if you see the see also, and this actually doesn't look like they included the see also in this particular man page. So if we do man paru again, like so go to the bottom. You can see there are other man pages that it suggests you take a look at, including make package, make package.conf, package build, pacman, pacman.conf and so on. So a lot of man pages will not only give you information about the command itself, but it will also give you information on other man pages that are related to whatever you're looking up. So if the information you have, or the information that you need rather is not there, check out some of those other man pages and you might find the information that you need. You'll also oftentimes find URLs to different places where you can look for help. So in this case here, it's telling you where you can report bugs if you needed to report bugs and Paru. A lot of times it'll give you links to further information where you can find more documentation. If it's not on a man page, it'll give you contact information for the developer. If you needed to contact the developer, a whole bunch of information here right inside of the man page. And it's just incredibly useful if you need to learn how to do something when it comes to a terminal application of some kind or a command inside of the terminal of some kind. So if we wanted to say a man LS, this is the man page for LS and there's a ton of stuff that you can do with LS, right? Show different permissions, show who the author is, a whole bunch of different commands and flags and stuff like that that go along with the LS command and this shows you all of them. You can come right here, it tells you what the flag is that you can use and then exactly what the flag does. A lot of times the man page will also point out directories on your computer that are important. So in this case of ZSH here, this shows you a whole bunch of paths and files and stuff on your computer that are important to ZSH. So if you're ever trying to locate a default configuration file for something or a global configuration file, a lot of times at the end of the man page, you'll find a section that says files and it will list all the files that are right that are important to that particular application right there. So let's just say you wanted to set a global environment variable for ZSH. This is the path of that file that you'd need to go visit if you wanted to do that for ZSH or for your system. And the same thing for the ZSH-HRC. If you wanted to create a, if you needed the default ZSH-HRC file, that's where that's located. You could go there, copy it into your home directory so you can make changes. So man pages are incredibly helpful for you if you're trying to learn any number of things. Now, like I said at the beginning, the helpfulness of the man page is really going to depend on the developer of the program because some developers do a fantastic job of creating a man page. I've shown you several that are fantastic. Some developers don't have a very good man page at all. So your mileage really is going to vary. Even the man command itself has a man page. So if you were ever wanting to learn more about man, you could come to the man page for man and take a look because there are other things that you could do with man in order to view the file. So you could change the way it's displayed and all this sorts of stuff. And I didn't even know this existed before just now. So surprisingly, there's a lot of stuff here when it comes to how you configure and can view man pages using the man command. So that's the general overview of man pages. Now, there are other tools like TLDR and stuff like that that do a different job when it comes to giving you documentation of commands in the terminal. Those tools do exist and maybe I will make videos on those in the future. But I believe that the best place to find documentation for commands in the terminal or terminal based applications is man pages. You go there, you find information and it's just a very good resource. And I would say that man pages are actually essential resources for anyone who wants to learn anything in the terminal. You go to a man page, you get the documentation, it tells you precisely what the terminal application or command is capable of doing. And it's just something that, and usually it's written in such a way that you can understand it. Now, you will find man pages that are very technical in scope and pros. So for example, the bash page that we looked at before, it's not going to make a lot of sense to you if you have no idea what you're doing. Unfortunately, it's written for people who are more technically minded and stuff like that. Now, it doesn't mean that there's nothing inside of that bash page that you will understand, but you'll probably find yourself stuck in the mud the further you go in because you're going to kind of be over your skis a bit. It's just going to be a little bit difficult if you're brand new to whatever it is you're searching for. And that's not just bash, but a whole bunch of other things, right? The more you get into a program, the more you're gonna learn, but you're obviously going to find some things that you just failed to understand because a lot of times, you know, it just gets more complicated, right? And that's more true of man pages than you probably would expect simply because they are written by developers. And a lot of times, the developers don't do a very good job of considering that new users might view their man page. Some of them, I'd say probably do a pretty good job, but you'll find some man pages that are just overly technical and they make a lot of assumptions on prior knowledge. And you know that those man pages probably aren't as useful as they probably could be. I find that those are fairly rare, but that's also might be my perspective because I understand and have been inside of man pages many times before. So my prior experience is probably coloring my judgment over whether or not man pages are more for new users or not. So, you know, it's an issue. But as I said before, your mileage may vary on the quality of the man page and the technological advanced knowledge that you'll need in order to actually read the man page. Sometimes you'll find that you'll need more. Sometimes it's written for new users. It really does depend. I find that man pages are really, really useful for me, but I also, like I said before, forget that they're there quite often, despite the fact that I know about them, right? It's a weird thing. It's like a resource that I understand is very useful, very valuable, but I also oftentimes use Google as a crutch. I think that that's my biggest issue when it comes to man pages is that oftentimes for me, it's just easier or more, it has become a habit, I should say, of instead of going to the man page of just going to Google and searching for the thing that I need to find on Google because it just seems to be easier. Despite that being the case, I still say that man pages are better simply because usually they come straight from the developer's mouth. You know what I mean? All the stuff that the developer tells you you can do with their program or command or whatever is right inside the man page and that means that the information is not going to be biased by other users. Now that doesn't mean that other users can't have good perspective on a command or an application and show you different ways of doing things. That's still a good thing to learn and to seek out, but the so-called official way of doing things is always good to learn too. So those are man pages. I highly recommend if you are learning anything in the terminal, search out a man page and you'll probably be happy that you did that. So that's it for this video. If you have thoughts on man pages, you can leave those in the comment section below. You can follow me on masses on our Odyssey. Those links will be in the video description. You can support me on Patreon at patreon.com slash linuxcast. Thanks to everybody who does support me on Patreon and YouTube, you guys are all absolutely amazing. Without you, the channels will not be anywhere near where it is right now. So thank you very much for your support. I truly do appreciate it. You guys could just seriously close my mind if you guys continue to support me. Thank you so very much. Thanks everybody for watching. I'll see you next time.