 One of the great things about the Linux command line is there is a lot of good help information, help documentation available for you right at the command line. But many new to Linux users especially find this kind of confusing. For one thing, there are multiple help kind of commands available for you at the command line to get documentation for various programs and you know they all differ slightly from one another and many new to Linux users kind of find it weird that we have so many of these help functions available for us at the command line. Why do we need both man pages and info pages for example? Well today we're going to discuss some of this. So let me switch over to my desktop. I'm going to go ahead and launch a terminal and I'll zoom way in. So probably the most common command that you're going to run at the command line to get help information is man. So you can run a man on LS for example. If you're not sure about all the flags and options available for you using the LS command, that's the standard list command that's part of the GNU core utils. And you can read through the man page. The man page is called man page because it's a manual. It's a manual page essentially. And what you could do by default man pages open using the less command less is also part of the GNU core utils. That's why it defaults to less as your man page reader. You can see I've got some fancy syntax highlighting because I've switched my man page reader from using less. It's actually using Neo Vim as the man page reader to get out of a man page. Just hit Q to quit. People often ask me about my man pages. How do I get that fancy colorful man pages? Again, it's because I'm using Neo Vim. Let me show you. If I do a vim.bashrc somewhere in here, I have export man pager. So you have this variable man pager all caps. That is the man page reader. By default, it is set to less, the less command. You can see I'm using in vim, Neo Vim, and then plus man with a capital M exclamation point. You set that. And now anytime you do man, let's do a man on man. Now it's actually Neo Vim. So J and K go up and down. If I do a capital G, it goes to the N, GG goes to the top, 10G goes to the 10th line, etc. All your vim commands Q to quit. Now the good thing with man pages is virtually every single program that you will install on your Linux system will also have an accompanying man page that gets installed, meaning practically everything has a man page. So when people online, you go to a Linux support form or chat room and people tell you to read the manual, right? They're telling you to read the man page for the particular program that you're asking about, right? So if you didn't know about the CP command, the copy command, you could man CP, for example. And when I say everything has a man page, you're going to have tens of thousands of man pages probably on your system. The way man works, if I do a man on man again, is your man pages are divided up into several sections. You can see you have section numbers one through nine here. You can see a section one, which is one of the largest groups. That's all your executable programs or shell commands. So for example, if I do that man on LS again, you can see LS, this is the man page for LS and you can see parentheses one. So it is belonging to section one of your man pages if I go back to man man. And you can see section two is all the system calls. These are functions provided by the kernel. Section three are the library calls for special files usually found in slash dev, etc. You have section six, which is games, seven is miscellaneous. A lot of the man pages that you're typically going to be searching for, they typically are going to be in section one. Sometimes they'll be in section three. I'm usually don't find man pages in the other sections that I'm I'm constantly searching for at least for my personal use. And one of the good things about man pages is because everything practically has a man page. It can always be your go to for help documentation. A matter of fact, most Linux distribution, I wouldn't say most, but a lot of the large Linux distributions historically have pushed people to write man pages. They want all the programs in their repository of software to have a man page accompanying it. So where things can get confusing for new users is other than man pages. You also have info pages. If I do info LS, this is the info page for LS. You know, that's again, I got a lot of the same kind of information, a lot of flags and options and things like that. Let me cue to get out of that. If I just run info without an argument, this is the top page of the info. You can think of it almost like a book. You know, he's got table of contents. Pretty much everything found in info can be found from the top level down. You've got links. It's really like hyperlinks, like you're following web links. For example, if I wanted to read about Dear Ed, which is the file manager inside Emacs, there's info page for that. And if I wanted to, I could go down and there's more links here that I could find a file at point. I could read that page. And how you navigate this is actually you have to use the Emacs key bindings, which are the same key bindings you typically use inside your bash shell for most users. So next is in P is previous. So if I go in for next, that's the next node, essentially the next page in the book. If I do P previous, previous nodes or the previous page in the book, I can keep going back. If I want to go up and down by lines, you can use the arrow keys, but you can also use the standard Emacs bindings of control in for next and control P for previous. So next and previous lines in that case, Q to quit out of the info. Now, this is where things kind of get a little weird. Why do we have both man pages and info pages? Well, they're not really the same thing. The info pages were started by the GNU project info is a GNU project. The GNU project started in the 1980s. They were working on the GNU operating system. They, you know, created the GNU Emacs GNU bash, all the GNU core utils, et cetera, that eventually became part of the GNU slash Linux operating system and they had their own help pages, the info pages that were created in the 1980s. So it really predates Linux itself, the operating system we know now. So info is quite old. Also info is written using the tech info formatting using it almost resembles hyperlinks HTML. It's a very similar kind of syntax, even though the info pages were actually created before the worldwide web was ever a thing. Well before almost a decade before the web and the GNU info pages naturally originally were built mainly for documenting the GNU programs. For example, like the core utils. So the info page on CP, for example, or the info page on the bash shell, which is a very nice read essentially a book with links, lots of chapters. So if you're interested at all in bash scripting and learning more about the bash, you know, reading the info page on bash would be a good place to start. So naturally the question becomes if info is a thing and has been a thing for going back 40 years, going back really, you know, like the mid 1980s, why aren't info pages the standard on Linux? Why are man pages the standard? Well, there's actually a good reason for this. As old as info pages are, man pages are actually a little older, actually quite a bit older. Man pages date back all the way to the 1970s, dating back to the old Unix operating systems. The very first man page was actually written in 1971, if you can believe it. So we're going back decades and decades. So man pages have always been a thing and essentially man pages just became the de facto standard at some point for pretty much all Unix like operating systems. That said, if you want good help documentation on anything GNU related, and especially I mentioned info bash, I would also say info EMAX is also great documentation. It's very lengthy, considerable documentation about EMAX. You can also info EMAX inside EMAX itself. If I actually launch EMAX into a meta X info, there is a info within EMAX itself. And I've got information about all of the EMAX related programs that I have installed, including the ones that were built into EMAX and then the ones that have the red asterisks, that is EMAX programs, third party programs. I installed myself, they get info pages, I guess added to the info database after I installed them. So that's kind of neat. Now many non GNU programs also have info pages. If I did an info on PC man FM, for example, PC man FM has an info page, but it's really just the man page, right? It's an exact copy of the man page as kind of, I guess, essentially you can think of it as a straight clone of the man page. And you will find a lot of non GNU programs that do just that, they have a man page and an info page, but really the info page is essentially the man page. So there's no hyperlinking, they're not really taking advantage of the cool features with info. So while man and info provide you really in-depth documentation about something, sometimes you just want really quick, brief documentation on something, and that is where the dash dash help flag comes in. So for example, if I did an LS space dash dash help, instead of a massive man page, all I get are the flags and options for LS. Actually, in this case, I get the exa dash dash help because LS in my case is a list to the exa command. So let me actually do CP dash dash help, something that isn't aliased, and that is the help information for CP. Again, once again, I get the flags and options and kind of like man, everything has a man page. Almost everything will have a dash dash help option as well. For example, if I do man dash dash help, there's all the flags that I could have used with the man command. Now, one thing that I do need to mention, because again, new to Linux users sometimes get confused by this is this dash dash help flag. When people talking about getting help information at the command line, some people get that confused. In the bash shell, there is actually help. You can just run the command help. And this is not the same thing. Help inside the bash shell, just the command help. It lists all the built in commands within the bash shell itself. It is bash specific. So that's not the same thing as tacking on the dash dash help flag on a command. Now, everything I've talked about this for, man, info, the dash dash help flag, and the help command inside the bash shell, they're all pretty much standard commands that are going to be available for you on practically any GNU slash Linux operating system. Those commands are always there, but I do want to show you one interesting help kind of program that's not pre-installed on any GNU slash Linux system, but I think it probably should be because I think it's fantastic. And I've shown this on camera many times in my videos, but I'm talking about the TLDR command. So if I do TLDR with no arguments, you get the TLDR help information. That's exactly the same as doing TLDR dash dash help. But TLDR, you give it a argument such as TLDR LS for the LS command. And what you get instead of a lengthy manual page or info book or something that's going to take a long time to read because LS does have a lot of flags and options available for you. What TLDR is, it's the Cliff's Notes version of a command, right? Basically it gives you like 10 of the most common ways to use that particular command. So here we've got about eight ways to use the LS command, some of the most common flags and options people tend to use with the LS command if I up arrow and do a TLDR on CP for the copy command. You can see there are various examples on how to use the copy command. And where TLDR really shines is when you're searching for help information on something that is really complicated like the GNU find command, the find man page is massive because find has a ton of flags and options. And sometimes I'm not looking for something that's really obscure, I'm looking for some of the most common ways to use the find command and I don't wanna have to read this massive document to find those really common ways to use the find command. So that's where something like TLDR comes in handy. So if I do TLDR on find, these are the most common ways people probably use the find command. And if I had to do a man on find, well, good luck finding that information in this ridiculously long novel and I'm not even probably 5% of the way through this thing yet just scrolling down with my mouse. It'll scroll, I could scroll for the next 10 minutes probably, it's a huge man page. Let me cue and quit out of that man page. So there you have it, several different ways to get help documentation right there at the command line for your various programs on your GNU slash Linux system. So you have man pages essentially for almost every single program on the system. Man pages typically probably need to be the first place you go, info is great if it's a GNU related program and actually a lot of your software on your GNU slash Linux system is GNU software. All of the GNU core utils which is a lot of your command line utilities, those are part of the GNU core utils. So info pages on that stuff, great. Info on bash is great. Info on Emacs is great. And then you'd have the dash dash help flag for an abbreviated kind of list, right? Instead of all the documentation you're just getting the flags and options listed for the most part. And then finally you have TLDR which is great. You get, you know, six to 10 of the most common ways to use that particular command that you're asking about. Now before I go, I need to thank a few special people. I need to thank the producers of this episode. Daniel Gabe, James Matt, Paul, Royal West, Armored Dragon commander, angry George Lee, Methos, Nate, Erion, Paul, peace archimador, realities were less, red prophet, Roland, Solastri, Tools Devler, Wargent 2 and Ubuntu, and Willie, these guys. My highest tiered patrons over on Patreon without these guys. This little episode about man and info and dash dash help it wouldn't have been possible. The show's also brought to you by each and every one of these fine ladies and gentlemen. All these names you're seeing on the screen right now. These are all my supporters over on Patreon. I don't have any corporate sponsors. I'm sponsored by you guys, the community. If you like my work, wanna see more videos about free and open source software like man and info. Subscribe to DistroTube over on Patreon. Peace guys. And you can also just read the arch wiki.