0

On MAC terminal, how can I get output something like this:

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)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
  • On older systems (through 10.5 at least), you would use man manpages, but Apple appears to have removed this manual page from more recent OSX releases. – user4556274 Jun 7 '17 at 12:17
0

May be something like this?

man -a intro |                            # awk grabs the header from each intro man page
awk '/INTRO/ { $1 = substr($1,7,1)        # set $1 to x in INTRO(x)
               $2 = ""                    # set $2 to nothing
               sub(/INTRO\([0-9]\)/, "")  # remove the string INTRO(x) from last field
               print | "sort"
}'

The results:

1  General Commands Manual 
2  System Calls Manual 
3  Library Functions Manual 
5  File Formats Manual 
7  Miscellaneous Information Manual 
8  System Manager's Manual 
9  Kernel Developer's Manual 

Note the missing sections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.