Help in Linux: --help and man

Updated November 1, 2026

--help prints a brief usage summary, while man opens the full manual.

Common cases

mkdir --help     # a short reference in the terminal
man ls           # the full manual, q to quit
man 5 passwd     # section 5: a file format, not a command
apropos network  # search man pages by keyword

Sample output

$ mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.
...
  -p, --parents     no error if existing, make parent directories as needed,
                    with their file modes unaffected by any -m option.
  -v, --verbose     print a message for each created directory
...
$ apropos "list directory"
dir (1)              - list directory contents
ls (1)               - list directory contents
vdir (1)             - list directory contents

How it works: man sections

The man manuals are split into numbered sections: 1 for user commands, 5 for file formats, 8 for admin commands. So man 5 passwd describes the /etc/passwd file format, while man 1 passwd is the password-changing command. --help is built into the program itself and always at hand, while man lives as separate files on the system. The real skill is not memorising flags but finding them here quickly.

Common mistakes

-h is not short for --help. On ls the -h option prints sizes in kilobytes and megabytes, the listing comes out as usual, and no help appears. mkdir has no such option at all: mkdir -h answers mkdir: invalid option -- 'h' and points you at mkdir --help. The long form works almost everywhere, the short one is a gamble.

man depends on what was installed on the system. In Ubuntu containers, including this course's sandbox, man ls prints This system has been minimized... instead of the manual page: the pages were cut from the image to keep it small. --help sits inside the executable itself and always answers, and apropos finds a command by its description.

Some programs print their help on the error stream, not on standard output. That is why ip --help | grep addr finds nothing: ip --help 2>/dev/null | wc -l gives 0, so standard output is empty. To search such help, merge the streams: ip --help 2>&1 | grep addr.

Used in

You need this in the lesson Getting help. The theory is the chapter Getting help: man and --help.

See also

which, type, whereis.

Try it

Open the sandbox: a real throwaway Linux terminal in your browser. Run the commands above by hand - the container is deleted when you leave.