whatis

whatis linux command cheatsheet by Thamizhiniyan C S

Introduction

The whatis command is used to display one-line manual page descriptions.


Syntax

whatis [-dlv?V] [-r|-w] [-s list] [-m system[,...]] [-M path] [-L locale] [-C file] name ...


Important Flags

FlagDescription

-d, --debug

Emit debugging messages.

-v, --verbose

Print verbose warning messages.

-r, --regex

Interpret each keyword as a regex.

-w, --wildcard

The keyword(s) contain wildcards.

-l, --long

Do not trim output to terminal width.

-C, --config-file=FILE

Use this user configuration file.

-L, --locale=LOCALE

Define the locale for this search.

-m, --systems=SYSTEM

Use manual pages from other systems.

-M, --manpath=PATH

Set search path for manual pages to PATH.

-s, --sections=LIST, --section=LIST

Search only these sections (colon-separated).

-?, --help

Give this help list.

--usage

Give a short usage message.

-V, --version

Print program version.


Examples

CommandDescription
whatis -h

Prints the help message.

whatis -d ls

Prints the debugging information.

whatis -v ls

Prints verbose warning messages.

whatis -r ls

Supports regular expression searches.

whatis -r '^ab'

Searches and displays short descriptions of commands and functions matching the regular expression '^ab'.

whatis -r '^cd'

Searches and displays short descriptions of commands and functions matching the regular expression '^cd'.

whatis -r 'cd$'

Searches and displays short descriptions of commands and functions matching the regular expression 'cd$'.

whatis -w ls

Enables wildcard searches using the specified pattern.

whatis -w 'ab*'

Searches and displays short descriptions of commands and functions matching the wildcard pattern 'ab*'.

whatis -w 'cd*'

Searches and displays short descriptions of commands and functions matching the wildcard pattern 'cd*'.

whatis -l cat

Displays long descriptions in addition to the summary.

whatis -s 3 cat

Allows users to specify the sections from which to retrieve the information. By default, it searches all sections.

whatis -s "1","2" cat

Accesses information from sections 1 and 2 of the manual page for the cat command.

whatis -m NewOS rmdir

Accesses manual page names for other operating systems.

whatis -m OS2 rmdir

Accesses the short description of the rmdir command from the OS2 manual pages.

whatis cd -M --manpath=/lib/cd

Specifies an alternate set of colon-delimited manual page hierarchies to search. It overrides the default value of the $MANPATH environment variable.

whatis rm -L locale

Temporarily overrides the determined locale value, allowing users to supply a locale string directly to the 'whatis' command.

whatis -C file

Specifies a user configuration file for the 'whatis' command, overriding the default configuration file location ~/.manpath.

whatis -?

Prints a help message.

whatis --usage

Displays short information about the whatis command and exits.

whatis -V

Displays version information.

whatis ssh-import-id

Displays the trimmed output of the ssh-import-id command.

Last updated