5 ms·
The “section”[0] or “subpage.” Programs are section 1, hence ‘dd(1)’ The idea is that it can be possible for a library function (section 3) to have the same nam
by colejohnson66 4y ago
The “section”[0] or “subpage.” Programs are section 1, hence ‘dd(1)’ The idea is that it can be possible for a library function (section 3) to have the same name as an executable. In which case, you’d type into your shell:
man 1 <name> # executable: <name>(1)
man 3 <name> # function: <name>(3)
Without the distinction argument, man will throw its arms up in the air and give up.
However, if there’s no ambiguity (such as with ‘dd’ where only the executable exists), you can drop the section number parameter when running man. man will then search all the sections, see that ‘dd’ only exists in section 1, and go from there.
[0]: https://linux.die.net/man/ https://linux.die.net/man/
- dredmorbius 4y agoCorrect. I also use the notation as a convention to indicate that I'm referring to a Unix command (or library function, etc.). E.g., "cat" might refer to a feline, but "cat(1)" should more clearly refer to the Unix / Linux command. (Where I've got proper markup, I'll typically set commands or references in monospace using backtick notation: `dd`, `cat`, etc.
- NAR8789 4y agoWhat do you do if you need to unambiguously refer to cat-as-in-feline?
- eesmith 4y agocat (Felis catus) ;)
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- dredmorbius 4y agoI show claws.
- CRConrad 4y ago> Where I've got proper markup, I'll typically set commands or references in monospace You can do that here by putting them on a separate line (two newlines, separate paragraph) and indenting by a couple characters.
- zengargoyle 4y agoSomething like `read` gives a better example. Like `man 1 read` is "read — read from standard input into shell variables", "read [-r] var...", a shell function. And `man 2 read` is " read - read from a file descriptor", "ssize_t read(int fd, void buf, size_t count);". You can also get into `man 8 catman`, "catman - create or update the pre-formatted manual pages", "catman [-d?V] [-M path] [-C file] [section] ...". The `catman` is a mirror-like hierarchy of man pages (usually in troff format using the 'an' macro package) pre-formatted for the standard terminal or whatever to shave off a bit of time running roff on the source files all the time. This is all ancient knowledge and well in place back in the mid 1980's long before Linux or any of that stuff. The `man` page sections used to be different 3-ring binders all printed out sitting on a table in the computer lab. The 'sections' were just different binders of documentation. Get off my lawn!!!
- jwilk 4y ago> Without the distinction argument, man will throw its arms up in the air and give up. At least in man-db and FreeBSD implementations, it actually shows you the first page it found by default.
- colejohnson66 4y agoYou're correct; I thought that might've been wrong... I just tested, and `man man` opened man(1) despite man(7) existing.
- OJFord 4y agoOr config in 5 is another perhaps more likely to come across as a user.
- xigoi 4y agoWhy is it random numbers rather than readable words? man exe <name> man lib <name>
- karatinversion 4y agoAs I understand it, because it descends from printed manuals with numbered sections.
- colejohnson66 4y agoYep. Executables are section 1 simply because they came first in the binders. There's nothing necessarily preventing man from allowing string codes as a replacement, but man interprets (fully) non-numeric arguments as pages to go. So `man cat dd` (on Ubuntu) will first open cat(1), and when you exit (with 'q'), will prompt if you want to continue. If you say yes, it'll open dd(1). That has the side effect than `man exe dd` would be interpreted as opening exe(#) (printing "No manual entry for exe") followed by dd(1).