Mastering the Linux ‘help’ Command: Options, Syntax, and Real‑World Examples
This guide explains how to use the Linux help command to display built‑in shell command information, outlines its syntax and available options, and provides concrete examples showing short descriptions, manual‑style output, and syntax summaries for commands like pwd.
help: display help information
Function description
The help command shows help for internal shell commands. It cannot display help for most external commands, which require man or info instead.
Command syntax
help [options] [builtin]Option meanings
The options are defined as follows:
-d – display a short description of the built‑in command
-m – display help in the format of a man page
-s – display a short syntax summary of the built‑in command
Reference examples
Example 1
Show a short description for the pwd command:
# help -d pwd
pwd - Print the name of the current working directory.Example 2
Show man‑page‑style help for the pwd command:
# help -m pwd
NAME
pwd - print name of current working directory.
SYNOPSIS
pwd [-LP]
DESCRIPTION
Print the name of the current working directory.
Options:
-L print the value of $PWD, which may contain symbolic links
-P print the physical directory without any symbolic links
EXIT STATUS
Returns 0 unless an invalid option is used or the current directory is unreadable.Example 3
Show a short syntax description for the pwd command:
# help -s pwd
pwd: pwd [-LP]Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
