LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How Do You Get to Linux Command(2)? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-you-get-to-linux-command-2-a-4175581658/)

Ned Radd 06-07-2016 09:09 AM

How Do You Get to Linux Command(2)?
 
In the Man and Info Pages. you frequently see references to alternative pages that you can look up, but nowhere does it say how to get to those pages.

For instance, in a terminal window I can enter on the command line the following command:

man man

Turns out, man can do a lot. Near the bottom though, you find this:

SEE ALSO
apropos(1), groff(1), less(1), manpath(1), nroff(1), troff(1), whatis(1), zsoelim(1), setlocale(3), manpath(5), ascii(7), latin1(7), man(7), catman(8), mandb(8), the man-db package manual, FSSTND

The ones that have (1) after them are easy to reach, as that is the default. But how about ascii(7), latin1(7), catman(8) and mandb(8)? How do I get to them?

AlucardZero 06-07-2016 09:13 AM

Code:

man  [-C  file]  [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-m
      system[,...]] [-M path] [-S list] [-e  extension]  [-i|-I]  [--regex|--wildcard]
      [--names-only]  [-a] [-u] [--no-subpages] [-P pager] [-r prompt] [-7] [-E encod‐
      ing]  [--no-hyphenation]  [--no-justification]  [-p  string]  [-t]  [-T[device]]
      [-H[browser]] [-X[dpi]] [-Z] [[section] page ...] ...

-> man 7 ascii

hazel 06-07-2016 11:53 AM

The way man works is that it goes through all the sections in numerical order until it finds a match for what you entered. So in most cases man foo will get you the man page on foo, whatever section it's in.

Sometimes though that doesn't work. In particular there are a lot of very basic Linux commands that have the same names as the library functions that actually do their work.

Now if this is a general user command, there is no problem because user commands in section 1 take precedence over functions in sections 2-3. But if it is a housekeeping command in section 8, man foo will display the function and not the command. In such cases you just need to include the section number: man 8 foo.

Ned Radd 06-09-2016 12:03 PM

Thanks! Put the number first. I would never have thought of that. Pays to ask questions sometimes. Let me give it a try. Yep, it works. Found that the number references a section in the document that is being referred to. Not every section is involved. And man 1 man does not work to bring up Section 1, the default. A final curio is that I can put in a really large number like man 999 catman, and it seems to return the highest section it can find a match in. Handy to know.


All times are GMT -5. The time now is 06:05 AM.