# info > LEXGROG

---
type: CommandReference
command: lexgrog
mode: man
section: "1"
source: man-pages
---
## Quick Reference
- `lexgrog file.1` — Extract name and description from man page source
- `lexgrog -fw file.1` — Show preprocessing filters and description
- `lexgrog -c catpage.cat1` — Parse preformatted cat page
- `lexgrog -d file.1` — Debug parsing with verbose output
- `lexgrog -E utf-8 file.1` — Set character encoding for input
- `lexgrog -m file.1` — Force man page source parsing (default)
- `lexgrog -f file.1` — Display only preprocessing filter list
- `lexgrog -w file.1` — Display only name and description

## Name
`lexgrog` — parse header information in man pages

## Synopsis
shell
lexgrog [-m|-c] [-dfw?V] [-E encoding] file ...
Reads man page source files or preformatted "cat" pages and displays their name, description (as used by `apropos` and `whatis`), and/or the list of preprocessing filters required before formatting with `nroff` or `troff`.

## Options
- `-d, --debug` — Print debugging information.
- `-m, --man` — Parse input as man page source files. This is the default if neither `--man` nor `--cat` is given.
- `-c, --cat` — Parse input as preformatted cat pages. Mutually exclusive with `--man`.
- `-w, --whatis` — Display the name and description from the man page's header. This is the default if neither `--whatis` nor `--filters` is given.
- `-f, --filters` — Display the list of preprocessing filters required before formatting.
- `-E encoding, --encoding encoding` — Override the guessed character set for the page to `encoding`.
- `-?, --help` — Print a help message and exit.
- `--usage` — Print a short usage message and exit.
- `-V, --version` — Display version information.

## Examples
shell
$ lexgrog man.1
man.1: "man - an interface to the system reference manuals"
shell
$ lexgrog -fw man.1
man.1 (t): "man - an interface to the system reference manuals"
shell
$ lexgrog -c whatis.cat1
whatis.cat1: "whatis - display manual page descriptions"
shell
$ lexgrog broken.1
broken.1: parse failed
For successful extraction, the man page's NAME section must follow traditional format: `.SH NAME` with `name \- description`, or the BSD mdoc `.Nm`/`.Nd` macros.

## See Also
- [apropos(1)](https://www.chedong.com/phpMan.php/man/apropos/1/markdown)
- [man(1)](https://www.chedong.com/phpMan.php/man/man/1/markdown)
- [whatis(1)](https://www.chedong.com/phpMan.php/man/whatis/1/markdown)
- [mandb(8)](https://www.chedong.com/phpMan.php/man/mandb/8/markdown)

## Exit Codes
- `0` — Successful program execution.
- `1` — Usage error.
- `2` — `lexgrog` failed to parse one or more of its input files.
