Search UNIX Man Pages for Oracle DBA Tools with man -k
Search UNIX Man Pages for Oracle DBA Tools with man -k
Purpose
Where Google answers most "how do I do X in UNIX" questions for a DBA today, man -k answers the narrower one — what tools the host actually has installed, and what each one does, without leaving the SSH session. Production Oracle hosts often run in change-controlled networks with no outbound HTTP, no browser, and a tight maintenance window; man -k and its synonym apropos are the offline discovery commands that close the gap between knowing a vague capability exists and finding the binary that delivers it.
man -k <keyword> searches the short description (the NAME line) of every installed man page for the keyword and prints every match grouped by chapter. It complements whereis (which only locates a known command), which (which only resolves a name on the PATH), and info (which is GNU-specific and rarely populated on commercial UNIX hosts).
For an Oracle DBA the practical use is short: when a script references a tool you do not recognise, or a procedure calls for "the standard utility that does X," man -k resolves the lookup in two keystrokes against the binaries actually present on this host's version of AIX, Solaris, HP-UX, Oracle Linux, or RHEL.
Code
1# Search all man page NAME lines for the keyword
2man -k <keyword>
3
4# Examples for an Oracle DBA
5man -k compress # find compression utilities (gzip, bzip2, xz, compress)
6man -k disk # find disk-related tools (df, du, fdisk, iostat)
7man -k schedule # cron, at, batch, anacron
8man -k -s 1 oracle # restrict to chapter 1 user commands only
9
10# Synonym — same database, different command name
11apropos oracle
Code Breakdown
man -k <keyword>— Searches the short description line of every man page inMANPATHfor the keyword. Output format iscommand (chapter) - short description. Matching is substring against the NAME line and is case-insensitive on most modern builds.man -k compress— Returns every utility whose NAME line mentions compression. On Oracle Linux this typically returnsgzip,bzip2,xz,compress, andzcat— the full picture of what is available before scripting a log rotation that uses one of them.man -k -s 1 oracle—-s 1restricts the search to chapter 1 (user commands). Without it the search also returns chapters 5 (file formats, e.g.oratab(5)where shipped) and 8 (admin) where they exist. Chapter restriction is essential when a generic keyword likelockwould otherwise return hundreds of unrelated matches.apropos <keyword>— Functionally identical toman -kon every modern UNIX. The two are aliases pointing at the same underlying lookup; use whichever is in muscle memory.
Key Points
- Lookup is index-based, not live.
man -kreads from a pre-built database (/var/cache/man/index.dbon Debian-family Linux,whatisfiles in each man directory on commercial UNIX) populated bymandb,makewhatis, orcatman -w. If the database is empty or stale, results will be incomplete or absent — see Troubleshooting below. - Man chapters are not uniform across UNIXes. Chapter 1 (user commands) and chapter 8 (admin commands) are consistent on Linux; chapter 1M on Solaris is the equivalent of chapter 8 on Linux. When sharing a
man -krecipe across platforms, drop the-schapter restriction to stay portable. - Oracle's own binaries rarely ship man pages.
sqlplus,lsnrctl,rman,expdp, and most other Oracle utilities print help via-helpflags rather than man pages.man -k oracleis most useful for finding the surrounding UNIX tools —cron,lsof,truss,dtrace— rather than Oracle binaries themselves. man -krespectsMANPATH. If a tool is installed under/opt/freeware/bin(common on AIX) or/usr/local/manandMANPATHdoes not include itsman/subdirectory, the tool is invisible to the search. Append paths withexport MANPATH=$MANPATH:/opt/freeware/share/manin.profile.- Locale matters on translated systems. On hosts with
LANG=ja_JP.UTF-8or other non-C locales,man -ksearches the localised description if the localised man page is installed. Force C locale withLANG=C man -k <keyword>for predictable English-only output in scripts.
Insights and Best Practices
Refresh the index after package changes
After installing a package — yum install lsof, dnf install strace, installp -ac iostat on AIX — the new tool is on PATH instantly but invisible to man -k until the index rebuilds. On Linux:
1mandb -q # rebuild quietly; takes 30-60 seconds on a typical host
On Solaris and older HP-UX:
1catman -w
A staged build host that runs the same yum install set as production but never rebuilds the index will return false-negative man -k lookups. Make mandb -q part of the post-install hook in Ansible, Puppet, or Chef plays.
Pipe to grep for compound keyword matches
man -k accepts only a single keyword. For compound searches — "find every utility whose description mentions both 'process' and 'memory'" — pipe to grep:
1man -k process | grep -i memory
This is faster than reading every chapter 1 page and is the right way to scope a search for ps-style memory introspection tools when you cannot remember the exact name.
Distinguish chapter conventions for DBAs
Three man chapters matter most for an Oracle DBA's offline lookups:
- Chapter 1 — user commands (
ls,find,grep,awk,sed) - Chapter 5 — file formats (
/etc/passwd(5),oratab(5)where shipped,crontab(5)) - Chapter 8 — system administration commands (
fdisk,mount,useradd,crontab(8)on some systems)
man 5 crontab describes the file format; man 1 crontab (or 8) describes the command. The chapter number resolves the ambiguity. man -k crontab returns both so you can pick.
Couple with whereis and which for full discovery
man -k finds tools by purpose. whereis finds the binary, source, and man page paths for a known command. which resolves the first match on the PATH. The three together answer:
man -k backup— what backup-related tools exist on this host?whereis tar— where are the tar binary, source, and man page?which tar— whichtardoes my PATH actually invoke (GNU tar vs BSD tar matters for--excludesyntax)?
A DBA who reaches for all three in sequence rarely needs to leave the host to answer a tooling question.
When to Run This
- When a runbook references a tool you have not encountered on this host's distribution
- When migrating a script from Linux to AIX/Solaris/HP-UX and need to find the equivalent of a missing GNU utility
- When a vendor support note says "use the standard X utility" without naming it
- During a change window with no outbound network access, when reading the man page is the only way to confirm a flag's behaviour
- As a first pass before installing new packages — the tool may already be present under a different name
Troubleshooting Common Issues
If man -k returns "nothing appropriate" for keywords that should exist, the index is empty or stale. On Linux distributions run sudo mandb -q and retry. On Solaris run catman -w. On AIX run /usr/bin/catman -w -M /usr/share/man.
If results are missing for a known-installed tool, check MANPATH. The manpath command prints the active search list, and manpath -d shows how each entry was selected. Add missing directories to ~/.profile if the tool was installed outside the default tree.
If apropos and man -k return different results on the same host, one of the commands is likely shadowed by a shell function or alias. Resolve with type apropos and type man to see which binary is actually being invoked.
References
- Oracle Linux 9 Administrator's Reference Guide — Oracle Linux user environment reference covering the man system and
MANPATHconfiguration relevant for Oracle DBAs running on Oracle Linux hosts - Linux man-pages project — apropos(1) — Michael Kerrisk's canonical Linux man pages reference for
apropos(and itsman -ksynonym), including options, exit codes, and the index database format - shutdownabort.com — Miscellaneous Useful UNIX (Wayback, 2013-01-15) — original source of the
man -krecipe in the DBA Quick Guides corpus - oracle-base.com — Linux Articles — Tim Hall's reference set covering the Linux subset an Oracle DBA needs to know, including command discovery and the man system
Posts in this series
- List Files Opened by an Oracle Process with lsof -p
- Delete the 500 Oldest Files in a Directory (Oracle DBA)
- Diagnose Oracle Net and RAC Interconnect Routing with netstat -r
- Unpacking Oracle Patch and Install Media with cpio
- Oracle Export Through a Named Pipe with mknod for Space-Constrained Hosts
- Recursive find and grep to Search Oracle Trace Files for Any String
- Find the Biggest Files First When an Oracle Filesystem Fills Up
- Scan Every Oracle Alert and Trace Log for ORA- Errors with grep
- vi Editor Commands Reference for Oracle DBAs
- Disable vi Autoindent Before Pasting SQL Scripts on Oracle Hosts
- Enable vi Command-Line Editing in ksh for Oracle DBA Shells
- Search UNIX Man Pages for Oracle DBA Tools with man -k