|

Linux CLI 9 🐧 whatis,apropos and info commands

These three commands help you discover and explore commands on your system. They’re complementary tools for finding the right command and learning more about it.


Overview

CommandPurposeBest For
whatisOne-line description of a commandQuick lookup when you know the name
aproposSearch by keywordFinding a command when you don’t know its name
infoDetailed hyperlinked documentationIn-depth learning about a command

The whatis Command

Displays a brief one-line description of a command.

whatis ls
whatis cp mv
whatis -w 'mv*'
whatis -r 'mv[ab]+'
sudo makewhatis
CommandDescription
whatis lsShow one-line description of ls
whatis cp mvShow descriptions for multiple commands
whatis -w 'mv*'Wildcard search
whatis -r 'mv[ab]+'Regex search
whatis -sCase-sensitive search
sudo makewhatisUpdate the whatis database

Examples

$ whatis ls
ls (1)               - list directory contents

$ whatis cp mv
cp (1)               - copy files and directories
mv (1)               - move (rename) files

$ whatis mkdir rmdir
mkdir (1)            - make directories
rmdir (1)            - remove empty directories

$ whatis cat
cat (1)              - concatenate files and print on the standard output

Multiple sections for the same name:

$ whatis mkdir
mkdir (1)            - make directories
mkdir (2)            - create a directory

Wildcard search (-w):

$ whatis -w 'mv*'
mv (1)               - move (rename) files
mvfn (1)             - move files with find integration

Regex search (-r):

$ whatis -r 'mv[ab]+'
mv (1)               - move (rename) files

Case-sensitive search (-s):

$ whatis -s LS
LS: nothing appropriate.
$ whatis -s ls
ls (1)               - list directory contents

Updating the whatis Database

If you’ve installed new commands and whatis doesn’t find them, update the database:

$ sudo makewhatis

Why? whatis searches a pre-built database of man page descriptions — not the man pages themselves. New installations may not be indexed yet.

Equivalent commands:

sudo mandb              # Common on Debian/Ubuntu
sudo makewhatis          # Common on Red Hat/CentOS

When to use it:

  • After installing software from source
  • After installing new man pages
  • When whatis returns “nothing appropriate” for a command that exists

The apropos Command

Searches the manual pages for a keyword — finds commands when you don’t know their names.

apropos directory
apropos "remove file"
apropos -w 'mv*'
apropos -r 'mv[ab]+'
apropos -a remove directory
apropos -s 1,2 directory
CommandDescription
apropos directorySearch for “directory”
apropos "remove file"Search for multiple keywords
apropos -w 'mv*'Wildcard search
apropos -r 'mv[ab]+'Regex search
apropos -a remove directoryMust include all keywords
apropos -s 1,2 directorySearch in specific sections

Examples

Single keyword:

$ apropos directory
basename (1)         - strip directory and suffix from filenames
chdir (2)            - change working directory
dirname (1)          - strip last component from file name
mkdir (1)            - make directories
mkdir (2)            - create a directory
pwd (1)              - print name of current/working directory
rmdir (1)            - remove empty directories
...

Multiple keywords (default OR):

$ apropos "remove file"
# Finds commands related to removing files
rm (1)               - remove files or directories
unlink (1)           - call the unlink function to remove the specified file
...

Note: By default, apropos treats space-separated words as alternatives (OR) — it matches commands whose description contains any of the keywords.

All keywords required (-a):

$ apropos -a remove directory
rmdir (1)            - remove empty directories
# Only matches descriptions containing BOTH "remove" AND "directory"

Wildcard search (-w):

$ apropos -w 'mv*'
mv (1)               - move (rename) files
mvn (1)              - Maven - Project Object Model
...

Regex search (-r):

$ apropos -r 'mv[ab]+'
mv (1)               - move (rename) files

Search specific sections (-s):

$ apropos -s 1,2 directory
mkdir (1)            - make directories
mkdir (2)            - create a directory
chdir (2)            - change working directory
pwd (1)              - print name of current/working directory
...

Sections: 1 = user commands, 2 = system calls, 3 = library functions, etc.


Practical Use: Finding the Right Command

You want to rename multiple files but don’t know the command:

$ apropos rename
rename (1)           - rename files
rename (2)           - change the name or location of a file
mv (1)               - move (rename) files
...

You want to search inside files but don’t remember grep:

$ apropos "search text"
grep (1)             - print lines that match patterns
rgrep (1)            - print lines that match patterns
...

You want to compress files but don’t know the tools:

$ apropos compress
bzip2 (1)            - a block-sorting file compressor
gzip (1)             - compress or expand files
tar (1)              - an archiving utility
xz (1)               - compress or decompress .xz and .lzma files
zip (1)              - package and compress (archive) files
...

The info Command

Provides more detailed, hyperlinked documentation than man pages.

info cp
info -k "copy"
info -f /path/to/file.info
CommandDescription
info cpShow info page for cp
info -k "copy"Search for a keyword in all info files
info -f fileUse a specific info file

Examples

Basic info:

$ info cp
# Displays a hyperlinked manual for cp

Search info files:

$ info -k "copy"
"copy" has the following matches:
- cp
- cpio
- dd
- install
- ...

Use a specific info file:

$ info -f /usr/share/info/coreutils.info

Info Navigation Shortcuts

The info command uses its own pager with hyperlinked navigation:

KeyAction
SpaceScroll ahead
BackspaceScroll back
nNext node
pPrevious node
uGo one level up
EnterFollow a link
lGo back in history
rGo forward in history
qQuit info

Info page structure:

File: coreutils.info,  Node: cp invocation,  Next: dd invocation,  Prev: cat invocation,  Up: Basic operations

'cp': Copy files and directories
================================

'cp' copies files...
  • File — which info file you’re in
  • Node — the current section
  • Next / Prev — sibling nodes
  • Up — the parent node

Man vs Info

Aspectmaninfo
FormatPlain textHyperlinked
NavigationLinear (scroll)Tree (nodes)
DepthModerateDeep
StructureSingle pageMultiple nodes
Best forQuick referenceIn-depth learning
CoverageEverythingGNU tools mainly

Key insight: For GNU tools (like cp, ls, bash), info often has more information than man. For other tools, man may be the only option.


Complete Example Session

# ============================================
# PART 1: WHATIS — QUICK DESCRIPTIONS
# ============================================

# Single command
$ whatis ls
ls (1)               - list directory contents

# Multiple commands
$ whatis cp mv mkdir
cp (1)               - copy files and directories
mv (1)               - move (rename) files
mkdir (1)            - make directories

# Multiple sections for same name
$ whatis mkdir
mkdir (1)            - make directories
mkdir (2)            - create a directory

# Wildcard
$ whatis -w 'm*'
mkdir (1)            - make directories
mkdir (2)            - create a directory
mknod (1)            - make block or character special files
mknod (2)            - create a special or ordinary file
more (1)             - file perusal filter for crt viewing
mount (8)            - mount a filesystem
mv (1)               - move (rename) files

# Update database
$ sudo makewhatis
# (no output — updates the database silently)

# ============================================
# PART 2: APROPOS — SEARCH BY KEYWORD
# ============================================

# Single keyword
$ apropos directory
basename (1)         - strip directory and suffix from filenames
dirname (1)          - strip last component from file name
mkdir (1)            - make directories
pwd (1)              - print name of current/working directory
rmdir (1)            - remove empty directories

# Multiple keywords (OR by default)
$ apropos "remove file"
rm (1)               - remove files or directories
unlink (1)           - call the unlink function to remove the specified file

# All keywords required (-a)
$ apropos -a remove directory
rmdir (1)            - remove empty directories

# Wildcards
$ apropos -w 'mv*'
mv (1)               - move (rename) files
mvn (1)              - Maven - Project Object Model

# Regex
$ apropos -r 'mv[ab]+'
mv (1)               - move (rename) files

# Specific sections
$ apropos -s 1,2 directory
chdir (2)            - change working directory
mkdir (1)            - make directories
mkdir (2)            - create a directory
pwd (1)              - print name of current/working directory

# Practical: find a compression tool
$ apropos compress
bzip2 (1)            - a block-sorting file compressor
gzip (1)             - compress or expand files
tar (1)              - an archiving utility
xz (1)               - compress or decompress .xz and .lzma files
zip (1)              - package and compress (archive) files

# ============================================
# PART 3: INFO — DETAILED DOCUMENTATION
# ============================================

$ info cp
# Shows hyperlinked manual for cp

# Search info pages
$ info -k "copy"
"copy" has the following matches:
- cp
- cpio
- dd
- install
- ...

# Using specific info file
$ info -f /usr/share/info/coreutils.info

# Navigation (in info)
# Press Space → scroll ahead
# Press n → next node
# Press p → previous node
# Press u → go up
# Press Enter → follow link
# Press q → quit

Quick Reference

whatis Options

OptionDescription
(none)Show description for a command
-wWildcard search
-rRegex search
-sCase-sensitive search
makewhatisUpdate the database (with sudo)

apropos Options

OptionDescription
(none)Search by keyword
-aRequire all keywords
-wWildcard search
-rRegex search
-s NSearch in specific sections

info Options

OptionDescription
(none)Show info page for a command
-k keywordSearch all info files
-f fileUse specific info file

info Navigation

KeyAction
SpaceScroll ahead
BackspaceScroll back
nNext node
pPrevious node
uUp one level
EnterFollow link
qQuit

When to Use Which

SituationUse
Know the name, want a quick descriptionwhatis cmd
Don’t know the name, want to find itapropos keyword
Want to search by keywordapropos -a word1 word2
Want detailed docs on a GNU toolinfo cmd
Want to search all docs for a phraseinfo -k "phrase"
Multiple commands’ descriptions at oncewhatis cmd1 cmd2 cmd3

Best Practices

Do This:

# Quick lookup when you know the name
whatis gzip

# Find commands by keyword
apropos "compress"

# Require multiple keywords
apropos -a "remove" "directory"

# Search specific section
apropos -s 1 "network"

# Get detailed docs
info coreutils

# Update whatis database after installs
sudo makewhatis

# Search info by keyword
info -k "extract"

Don’t Do This:

# Don't forget to update whatis database
whatis mynewcmd     # ⚠️ "nothing appropriate"
sudo makewhatis      # ✅ Update first

# Don't rely on apropos with common words
apropos "file"      # ⚠️ Returns hundreds of results
apropos -a "remove" "directory"  # ✅ Narrow search

# Don't forget info uses its own navigation
info ls
# Use Space, n, p, u, q — not arrow keys!

# Don't confuse sections in man vs info
man 2 mkdir          # ✅ Man section 2
info mkdir           # ✅ Info page (no sections)

Common Pitfalls

PitfallProblemSolution
whatis finds nothingDatabase not updatedRun sudo makewhatis
apropos too many resultsCommon keywordUse -a for all keywords
Can’t navigate infoWrong keysUse Space, n, p, u, q
Confusing man and infoDifferent navigationRemember: man is linear, info is hyperlinked
Wrong section for whatisMultiple entriesUse section number: man 2 mkdir

Visual: Choosing the Right Tool

┌──────────────────────────────────────────┐
│  What do you want to do?                 │
└──────────────────┬───────────────────────┘
                   │
        ┌──────────┴──────────┐
        │                     │
  Know the name?        Don't know the name?
        │                     │
        ▼                     ▼
  ┌──────────┐          ┌──────────────┐
  │ whatis   │          │  apropos     │
  │  cmd     │          │  keyword     │
  └────┬─────┘          └──────┬───────┘
       │                       │
       └───────────┬───────────┘
                   │
                   │ Need more detail?
                   ▼
             ┌──────────┐
             │  info    │
             │  cmd     │
             └──────────┘

Real-World Examples

1. Discovering Compression Tools

$ apropos compress
bzip2 (1)            - a block-sorting file compressor
gzip (1)             - compress or expand files
pigz (1)             - parallel implementation of gzip
tar (1)              - an archiving utility
xz (1)               - compress or decompress .xz and .lzma files
zip (1)              - package and compress (archive) files

2. Getting Details on a Known Command

$ whatis tar
tar (1)              - an archiving utility

$ info tar
# Opens the detailed info page

3. Finding All File-Removal Commands

$ apropos -a remove file
rm (1)               - remove files or directories
unlink (1)           - call the unlink function to remove the specified file

4. Updating the Database

# After installing a new tool
$ sudo apt install mytool
$ whatis mytool
mytool: nothing appropriate.
$ sudo makewhatis
$ whatis mytool
mytool (1)           - a great new tool

5. Detailed Information on Bash

$ info bash
# Opens the complete Bash manual
# Navigate with n, p, u, Space, Enter, q

Summary

CommandPurposeExample
whatisOne-line descriptionwhatis ls
aproposSearch by keywordapropos "remove file"
infoDetailed hyperlinked docsinfo cp

Key takeaways:

  • whatis — quick lookup when you know the namewhatis cmd
  • apropos — search by keyword when you don’t know the nameapropos keyword
  • info — the deepest documentation, especially for GNU toolsinfo cmd
  • sudo makewhatis — update the whatis/apropos database after installing software
  • apropos -a — require all keywords (narrows results)
  • apropos -s N — restrict to specific manual sections
  • info -k — search all info files for a keyword
  • info navigation — uses nodes and links: n (next), p (prev), u (up), Enter (follow), q (quit)

Remember: These three commands form your discovery toolkit. When you know a command’s name, use whatis for a quick description. When you don’t, use apropos to search by keyword. And when you want the deepest documentation, use info — especially for GNU tools, where info often has content that man doesn’t!


Stop using slow, ad-bloated tool sites! 🤮

🔎 Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
✅ Finance (Mortgage, Interest, Inflation)
✅ Tech (Base64, JSON, Dev Suite, IP)
✅ Health (BMI, BMR, TDEE)
✅ Productivity (Timer, Workspace, QR)

⚡️ Fast & Private
🔒 No data leaves your device
💎 100% Free

🔗 Use it now: https://tools.kandz.me
🔖 Bookmark it—you’ll need it later!