We have just seen that behind the command you can type help to get help.
There is a better way to get help, and that is man.
Now why should you use man? Well, MAN is specific to the system on which you are using it.
And that means that the information that MAN is showing is accurate.
MAN is also the only way to get help on a disconnected system.
You know, it has happened to me that I was working on a Linux system somewhere deep down in the data center.
There were three layers of security between the front door and the server I needed to work on.
And guess what? Apart from the system itself, I couldn't use my cell phone to
go online and to google for information. Well then it's convenient that there is man.
And also that is true if your system is disconnected, man doesn't hallucinate.
I know you may have used ChatGPT or other gen AI utilities to get information.
And even if that information often is pretty accurate, sometimes it's not.
And the AI solution is hallucinating. It's just making up some information that's not really true.
Also, if ever you are going to prepare for one of the
Linux exams, you won't have Internet access, you will have man.
So if you are planning to take Linux plus or RHCSA
or lfcs, you won't have Internet access, you will have man.
MAN stands for the System Programmer's Manual.
It is the main, but not the only source for getting information about Linux command usage.
I recommend you use MAN to get information about commands, configuration files and more.
Now in MAN pages you have sections and there's a couple of sections you need to know about.
Which is section one that is for end user commands.
Section eight is for administrator commands, these are commands that require root privileges.
And section 5 is for configuration files.
In a MAN page you will always have a couple of common elements.
There is the command summary which will show you how to use a command.
In this command summary you can see items between brackets.
If an item is listed between brackets, that means that it is optional. You may use it. You don't have to use it.
If you see curly braces in a pipe B, then it means that you must choose between either A or B.
You might also see that means that you may have more of the preceding item.
Bold or uppercase is used for placeholders, so you can use the word file in
uppercase. And it means that the command expects you to specify a file name.
Pretty often MAN pages have usage examples near the end and that is useful if you have a complex command.
If the Command is not complex, then you might not find these
usage examples, but you will always find related items to the end.
Now as a man page can be pretty big. Within the man page you can search
use slash followed by some text to search within the man page for some text.
If you are done with it and you need to get out, Q is the command to get out.
Let me show you how to use man.
Let's start with man ls.
Then what do we see? Well, there's a funny thing on the header line you can see LS
followed by A1. But do you notice LS is in uppercase in case you want to know why.
Well, there's a funny explanation for it.
Out of respect for history.
That is the very first man pages that were created
in the early 1970s were created on a typewriter.
In those days if you had a multi page document that you created on a typewriter, you
would create a header line. And in the header line you would normally type the subject.
And to distinguish it from the rest of the text, this subject was written in uppercase.
Now out of respect for history, man pages still have the command always listed in uppercase in the header line.
But the real way how you use the command is in the name right here.
This name has a command and a short description of the command. So LS is for list, directory contents.
And then we have the synopsis where LS can be used by options.
The word option is a placeholder, so you need to replace it with any option that you might like to
use and it's between square brackets and that means that you may use an option, you don't have to.
We also see behind the option and it means that you are allowed to put more than one option.
And likewise for file, which is also a placeholder.
Then you have a list of all the options with an explanation of the option
and use the spacebar to scroll down to get to the end of it.
Now, related command. Look at that, the
related command. We see also their colors.
So their colors in section one is a man page that obviously is about directory colors.
Also we see for full documentation about men, you can access
it through this URL or locally using the info command.
I really don't like the info command and honestly I never use it.
But let me give you a quick look at this info command.
Now let me paste the command and there we can see how this info looks like.
This is like a prehistoric webpage.
And that's what I don't like about it.
But there's a lot of text, a lot of explanation, and there are also items that are listed
with an asterisk. These items are menu items, and if you want to get more information about the
menu items, select either one of them and then you press Enter to go deeper in the menu.
And if you want to go up, you press U for up and if you have seen enough, you you press Q to quit.
Info is confusing Good news about Info is that you will be able to work with Linux
even if you don't know how to use info. It's not an essential way to get help.