Find contents of a man page

man

Can I find the contents of a man page?

man bash is almost 6000 lines long, and I would like to know the section headings within the page.

Best Answer

If you just want the section headings, grep for them. They are in ALLCAPS and are the only lines that have no leading spaces:

$ man bash | grep '^[A-Z]'
BASH(1)                                General Commands         Manual                                BASH(1)
NAME
SYNOPSIS
COPYRIGHT
DESCRIPTION
OPTIONS
ARGUMENTS
INVOCATION
DEFINITIONS
RESERVED WORDS
SHELL GRAMMAR
COMMENTS
QUOTING
PARAMETERS
EXPANSION
REDIRECTION
ALIASES
FUNCTIONS
ARITHMETIC EVALUATION
CONDITIONAL EXPRESSIONS
SIMPLE COMMAND EXPANSION
COMMAND EXECUTION
COMMAND EXECUTION ENVIRONMENT
ENVIRONMENT
EXIT STATUS
SIGNALS
JOB CONTROL
PROMPTING
READLINE
HISTORY
HISTORY EXPANSION
SHELL BUILTIN COMMANDS
RESTRICTED SHELL
SEE ALSO
FILES
AUTHORS
BUG REPORTS
BUGS
GNU Bash 4.3                               2014 February 2                                    BASH(1)