mansect(1)

okay bestie, welcome to mansect(1) from the General Commands Manual โ€” it's the little tool that prints the source code of sections of manual pages, and it's lowkey iconic ๐Ÿ’…

๐Ÿ’– NAME ๐Ÿ’–

mansect โ€” print the source code of sections of manual pages โœจ

โœจ SYNOPSIS โœจ

mansect section [file ...]

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so the mansect command prints the source code of the section of the given manual-page files. that's the whole main character energy of it ๐Ÿ’–

the .TH line is unconditionally printed โ€” no ifs, no buts, no vibe check, it's always coming through ๐Ÿซถ

and the output of this program is suitable for piping to the groff(1) pipeline โ€” literally built for that pipeline moment โœจ

๐Ÿ’… PARAMETERS ๐Ÿ’…

  • section โ€” a PCRE2 regular expression. yes bestie, a real PCRE2 regex, not just vibes ๐Ÿ”ฅ
  • file โ€” if no files are specified, the standard input is used. that's the rule, no cap ๐ŸŽ€

๐Ÿฆ‹ EXAMPLES ๐Ÿฆ‹

here's the whole thing in action, bestie:

$ man -w strtol strtoul | xargs mansect 'NAME|SEE ALSO';
.lf 1 /usr/local/man/man3/strtol.3
.TH strtol 3 2024-07-23 "Linux man-pages 6.9.1"
.SH NAME
strtol, strtoll, strtoq - convert a string to a long integer
.SH SEE ALSO
.BR atof (3),
.BR atoi (3),
.BR atol (3),
.BR strtod (3),
.BR strtoimax (3),
.BR strtoul (3)
.lf 1 /usr/local/man/man3/strtoul.3
.TH strtoul 3 2024-07-23 "Linux man-pages 6.9.1"
.SH NAME
strtoul, strtoull, strtouq - convert a string to an unsigned long integer
.SH SEE ALSO
.BR a64l (3),
.BR atof (3),
.BR atoi (3),
.BR atol (3),
.BR strtod (3),
.BR strtol (3),
.BR strtoumax (3)

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

go say hi to the whole friend group:

this page is from Linux man-pages 6.18, dated 2026-01-30, and it's mansect(1) โ€” love u, bye bestie ๐Ÿ’–๐ŸŽ€

๐Ÿ“ฆ where this page comes from