Tutorial

How to Get Help for Any Command at the Shell Prompt

Mister P
by  Mister P · on
Linux
Master the built-in help tools available at every RHEL shell prompt: --help flags, man pages, whatis, apropos, type, which, and info. This lab covers every help mechanism tested on the RHCSA EX200 exam and builds the muscle memory to find command syntax under exam conditions — without internet access.

How to Get Help for Any Command at the Shell Prompt

Note

Before running any commands: click the + button in the terminal tab bar to open a new terminal tab. The playground history tracking activates in new sessions only. Commands run in the original tab will not register for task verification.

On the RHCSA EX200 exam, the internet is not available. Every syntax question you face must be answered with the tools already on the system. This lab drills every built-in help mechanism so that looking up a flag or option becomes second nature under exam pressure.

By the end you will be able to:

  • Display compact usage summaries with --help
  • Open, navigate, and read man pages
  • Decode the SYNOPSIS section of any man page
  • Get one-line descriptions with whatis and man -f
  • Confirm whether a command is a builtin, alias, or external binary with type
  • Find the disk location of an external command with which
  • Search all man page descriptions by topic with apropos
  • Read extended GNU documentation with info

Step 1 — Display a Command's Built-in Usage Summary

The fastest help available for any command is its --help flag. It prints a compact list of options and exits immediately — no pager, no waiting.

ls --help

Scroll through the output. You will see every option ls accepts, its short and long forms, and a one-line description of each.

Important

A small number of commands use -h instead of --help. Shell builtins (like cd) do not support either flag — use help cd for builtins. If --help prints an error, that is your cue to try a different approach.

Output scrolled off the screen too fast?

Pipe the output through less to read at your own pace:

ls --help | less

Press q to quit less.


Step 2 — Open the Full Manual Page for a Command

man pages are the authoritative reference for every command on a RHEL system. They include all options, argument types, exit codes, environment variables, and often worked examples.

man ls

Navigate the manual page with these keys:

KeyAction
Space or fScroll forward one full page
bScroll back one full page
/patternSearch forward for text
nJump to the next search match
NJump to the previous search match
qQuit and return to the shell
Note

Exam technique: Once inside a man page, type /EXAMPLE and press Enter to jump straight to the examples section — most man pages have one. This saves time when you need to see real usage rather than reading option lists from the top.

man says "No manual entry for ls"?

The man-pages or man-db packages may be missing. Fix it with:

sudo dnf install -y man-pages man-db

On this playground both packages are pre-installed, so this should not occur.


Step 3 — Read the SYNOPSIS Section of a Man Page

Every man page opens with a SYNOPSIS section immediately below the NAME section. Learning to decode it unlocks every other man page you will ever read.

Open man ls again and find the SYNOPSIS near the top:

ls [OPTION]... [FILE]...

Decode each element:

NotationMeaning
Bold textType exactly as shown
Underlined / italic textReplace with your own value
[item]Optional — omit if not needed
item...Repeatable — provide one or more
{a|b}Choose one from the group

Applying this to ls [OPTION]... [FILE]...:

  • ls — type exactly as shown
  • [OPTION]... — zero or more options, all optional
  • [FILE]... — zero or more file paths, all optional

So ls, ls -l, ls -lh /etc, and ls /var/log /tmp are all valid invocations.

Note

You do not need to verify a command at this step — just read the SYNOPSIS inside man ls. This skill is tested implicitly every time you construct a correct command from documentation on the exam.


Step 4 — Get a One-Line Description with whatis

whatis prints the NAME section of a man page — a single line identifying what a command does. Use it when you know the name of a command but want a quick sanity-check before diving into its man page.

whatis ls

Expected output:

ls (1)               - list directory contents

The number in parentheses is the manual section:

SectionContents
1User commands
5File formats and configuration files
8System administration commands
whatis returns "nothing appropriate"?

The man page database has not been built yet. Rebuild it with:

sudo mandb

This takes about 30 seconds. Then retry whatis ls.


Step 5 — Determine How the Shell Resolves a Command

Before reading help for a command, confirm what it actually is. The shell can resolve a name as:

  • A shell builtin (implemented inside bash itself — has no disk location)
  • An alias (a shorthand for another command or with default options)
  • An external executable (a binary file somewhere in $PATH)
type ls
type cd
type cat

Typical output:

ls is aliased to 'ls --color=auto'
cd is a shell builtin
cat is /usr/bin/cat

This matters because:

  • Builtins (cd, echo, read, export) → use help commandname, not man commandname
  • Aliasestype shows what the alias expands to before you read options
  • External commandsman commandname works normally

For external commands, confirm the full path on disk:

which cat

Expected output:

/usr/bin/cat
Note

type and which answer different questions. type tells you how the shell resolves a name (including aliases and builtins). which only searches $PATH for external executables and ignores aliases and builtins entirely.


Step 6 — Search Man Pages by Topic with apropos

When you know what you want to do but not which command to use, apropos searches all man page NAME and DESCRIPTION lines for a keyword.

apropos "list directory"

You will see every command whose man page mentions "list directory" — including ls and related utilities.

Try a broader search:

apropos password

This returns commands related to password management: passwd, chpasswd, pwconv, and others.

apropos returns "nothing appropriate"?

The man page database needs to be (re)built. Run:

sudo mandb

Then retry. If a keyword still returns nothing, broaden it — for example search for "list" instead of "list directory".

Note

Exam technique: If you forget the name of a command during the exam, apropos is your first move. For example, if you need to change file permissions but cannot remember chmod, try apropos permission or apropos "change mode".


Step 7 — Read Extended Documentation with info

GNU tools such as ls, grep, tar, and awk often have extended documentation in the info system that goes beyond what their man pages cover — including tutorials, conceptual explanations, and more worked examples.

info ls

Navigate with these keys:

KeyAction
nNext node (section)
pPrevious node
uUp one level in the node tree
qQuit and return to the shell
TabJump to next hyperlink
EnterFollow a hyperlink
Note

If a topic has no dedicated info page, info automatically falls back to displaying the man page. So info commandname is always safe to try — you will get something useful either way.


Step 8 — Verify All Help Tools Are Working

Run this final check to confirm every help tool is operational. This is the pattern you should run at the start of an RHCSA exam to ensure the documentation system is healthy.

man -f ls

man -f is identical to whatis — it looks up the NAME section of a man page. If it returns output, the man page database is current.

Note

man -f ls and whatis ls produce identical output. The -f flag is the POSIX-specified form; whatis is the GNU convenience wrapper. Both appear on exams — know them as synonyms.


Troubleshooting Reference

SymptomMost Likely CauseFix
whatis lsnothing appropriateMan page database not built or outdatedsudo mandb
command --help → error or no outputCommand is a shell builtinUse help commandname instead
man lsNo manual entry for lsman-pages or man-db not installedsudo dnf install -y man-pages man-db
apropos keyword → nothingDatabase not indexed, or keyword too specificsudo mandb, then broaden the keyword
info command shows generic readerNo standalone info page existsFall back to man commandname

What You Practiced

ToolWhen to Use It
command --helpQuick option list — fastest lookup
man commandFull authoritative reference
whatis command / man -f commandOne-line identity check
type commandResolve builtin vs alias vs external
which commandFind disk path of external binary
apropos keywordFind the right command when you forget the name
info commandExtended GNU documentation
help builtinDocumentation for bash builtins
Note

RHCSA exam reality check: You will face commands you have never seen before. The exam allows man, info, --help, whatis, and apropos — and you are expected to use them. A candidate who knows how to find answers in the documentation is more exam-ready than one who relies solely on memorization.

About the Author

Mister P

Mister P

Find this author online

More tutorials you might like

Learn by doing, not just by reading or watching

Sign up for a free account to start a VM playground right on this page, track your progress, and get notified about new learning materials.

Sign up for free