Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
35
rated 0 times [  35] [ 0]  / answers: 1 / hits: 3229  / 2 Years ago, wed, september 21, 2022, 12:05:56

Just saw someone referencing man 7 regex on Stackoverflow. I tried man regex and got very similar output - there appear to be slight differences.



So what is this magical number 7? Searching man 7 unix on Google gives me more mysterious results like UNIX(7)...


More From » manpage

 Answers
6

About UNIX(7)


To answer your question of "UNIX(7)", this is standard convention of saying "The man page for UNIX in section 7 (miscellaneous)".


To open a page like init(8), you would use this command: man 8 init.




man regex vs man 7 regex


To answer your question of the 'subtle differences' between man regex and man 7 regex:


man by default opens the page with the lowest section number. In this case, it is section 3 (Library calls). Opening the page from section 7 (Miscellaneous) is quite different.


Pages in different sections address different things, though in this case they are similar, consider apt:


man -f apt:


apt (8)              - Advanced Package Tool
apt (1) - annotation processing tool

In this example, apt from section 8 (System administration commands) is completely unrelated to the page from section 1 (Executable programs or shell commands).


For future reference, use man -f PAGE_NAME to locate all pages with that name in all sections. You can then open a page from the section you want with man SECTION PAGE_NAME.


Manpage sections


The various page sections are as follows and can be found from man man:




  1. Executable programs or shell commands

  2. System calls (functions provided by the kernel)

  3. Library calls (functions within program libraries)

  4. Special files (usually found in /dev)

  5. File formats and conventions eg /etc/passwd

  6. Games

  7. Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)

  8. System administration commands (usually only for root)

  9. Kernel routines [Non standard]



[#28752] Wednesday, September 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
imberst

Total Points: 370
Total Questions: 107
Total Answers: 123

Location: French Polynesia
Member since Tue, Jul 7, 2020
4 Years ago
imberst questions
;