So if man is so important, it's also an important skill
that you can find the right man page.
And again, you can't Google on the exam.
You need to know how to do this.
So how do you do that?
Well, the man pages are indexed in the man DB.
And you can use man minus k or apropos.
It's exactly the same to search the man DB, which
is a database based on a keyword.
And when you do so, a lot of results can show.
And in order to filter down the results,
you can use graph as a filtering utility.
The man DB is built automatically
through a scheduled tasks.
And in case you get nothing appropriate on something
where you really should have a result,
you can build the man DB using studio man DB.
Let me show you.
All right, man minus k password.
So I'm looking for the command to set a password.
And oh my goodness, I'm getting nothing appropriate.
Then I want to do another test, man minus k user, which is also
giving me nothing appropriate.
And you know why?
That is because the man DB is automatically
built through a scheduled task.
And apparently, this scheduled task has not run yet.
So I need studio man DB.
This is definitely something that you
need with escalated privileges, because ordinary users cannot
create a man DB database.
While using studio, you need to enter
the password of the user that has studio privileges.
And that's happening right here.
And there we can see in the lower part of the screen
that almost 8,000 manual pages were added.
Well, that's good news.
So now I can use man minus k password again to see
that we have a lot of result.
Oh boy, that doesn't really fit on my screen.
Well, if it doesn't fit on the screen, first thing I do,
I send the output of man minus k password in a pipe
through the wc command.
This is how a pipe works.
The output of the first command is used as input
for the second command.
And wc is word count.
And word count is giving me 70 lines of result.
And also 633 words and 4,481 characters.
We don't care about it.
That's too much.
We care about the 70 lines.
Now, 70 lines for me is too much reading.
So I'm going to send it to the grep command.
And I'm making a guess here.
I'm not sure if we need user privileges or studio
privileges.
So I'm grepping on 1 so that I can only
see the commands that are in section 1.
And there I can see change user password.
That's the passwd command.
Now, funny fact is, why doesn't man minus k
have an option itself to look only in a specific section,
like man minus k1 password?
Well, that is of what we call the Linux philosophy.
In the original design of Linux, and before that of Unix,
the purpose was to have many powerful commands that
can do great things by combining the power of multiple commands
together.
And in the Linux philosophy, it totally
makes sense that you can do man minus k1 password.
Because we have the grep utility.
And the grep utility is an excellent way
to filter out the result. And that
is why using pipes in Linux is so extremely important.