Skip to content
shellmap

manDisplay the manual page for a command across all 5 shells

Equivalents in every shell

Bashunix
man grep

Reads the manual page for `grep` from `/usr/share/man/`. Pages are numbered by section: `man 1 ls` (user commands), `man 2 open` (system calls), `man 3 printf` (library functions), `man 5 passwd` (file formats), `man 7 hier` (overviews / standards), `man 8 mount` (admin / privileged). `man -k <keyword>` (or `apropos`) searches descriptions for a keyword — useful when you don't know the command name. Pages render with `less` by default; `q` quits, `/` searches.

Zshunix
man grep

Same external on macOS and Linux. macOS man pages are BSD-derived where Linux pages are GNU-derived — same command, different flags, different EXAMPLES section content. `man grep` on macOS describes BSD grep (no `-P` Perl-regex flag, different `-E` behaviour edge cases); on Linux it describes GNU grep. When copying invocations across platforms, check the man page on the target system rather than assuming.

Fishunix
man grep

Fish has its own built-in `help` for fish-specific topics (`help string` opens the docs for the `string` builtin in a browser). For external commands, `man` is the standard. Fish quirk: if you're used to ZLE / readline keybindings for searching in `less`, fish doesn't change `less` behaviour — its pager remains whatever `$PAGER` says (typically `less`, sometimes `bat` in modern setups).

PowerShellwindows
Get-Help Get-ChildItem -Full

PowerShell's help system is the `Get-Help` cmdlet (aliased `help`, `man`). `Get-Help <cmdlet>` shows basic syntax + parameters. `-Full` adds descriptions + examples + notes. `-Examples` jumps straight to examples. `-Online` opens the docs.microsoft.com page in your browser (often more current than the local help). FIRST RUN: pwsh ships with stub help — run `Update-Help` (elevated) once to download the real content. Without `Update-Help`, `Get-Help` shows the "Get-Help cannot find Help files" message.

cmd.exewindows
<command> /?

cmd.exe has no `man` equivalent — instead, every Windows builtin and most CLI tools support `/?` for help: `dir /?`, `tasklist /?`, `netstat /?`. The output is typically one screen, no pager. For Windows-specific subjects like CMD scripting itself, `help` (no args) lists commands; `help cmd` describes `cmd.exe`; `help <command>` is the verbose form of `<command> /?`. The richest docs are at learn.microsoft.com — `start https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dir` for the dir docs.

Worked examples

Show the manual page for `grep`

Bash
man grep
Zsh
man grep
Fish
man grep
PowerShell
Get-Help Select-String -Full
cmd.exe
findstr /?

Search for commands matching a keyword

Bash
man -k compress      # or: apropos compress
Zsh
apropos compress
Fish
man -k compress
PowerShell
Get-Command -Verb Compress
cmd.exe
help

Open online docs in the browser

Bash
xdg-open "https://man7.org/linux/man-pages/man1/grep.1.html"
Zsh
open "x-man-page://grep"
PowerShell
Get-Help Select-String -Online
cmd.exe
start https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr

Gotchas

  • Sections matter when names collide. `printf` is both a shell builtin AND a libc function — `man printf` defaults to section 1 (the shell command). For the C function: `man 3 printf`. Same for `passwd` — section 1 is the binary, section 5 is the `/etc/passwd` FILE FORMAT. `man -a passwd` shows ALL sections in order. When you're looking for "what does this file format look like" docs, you usually want section 5.
  • Many lightweight Linux distros (Alpine, distroless containers, busybox images) ship without `man` pages installed — even when the binaries are present. `man grep` on Alpine returns "No manual entry for grep" by default. Workarounds: `apk add man-pages grep-doc` (Alpine), or use `<command> --help` which gives a one-screen summary on most GNU tools and ALWAYS works.
  • `man --help` is occasionally surprising. On Linux, `--help` is the conventional flag for one-screen help (`grep --help`). On older BSD / macOS tools, `--help` is NOT recognised and may produce an error — the BSD convention is `-h` or just running the command without args. When porting scripts, expect `--help` to be the right choice on Linux GNU tools but unreliable elsewhere.
  • PowerShell `Get-Help -Online` opens docs.microsoft.com — but only for FIRST-PARTY cmdlets. Third-party modules (community modules from PSGallery) point `-Online` at whatever URL the module author set in the function metadata. Some module authors don't set it — `Get-Help SomeFunction -Online` errors out with "no URL configured". The `-Full` flag is the reliable fallback.
  • macOS's `man` uses `groff` for rendering; Linux's typically uses `mandoc` or `groff`. Result: the same `.1` source file may render slightly differently (bullets, columns, hyphens). Don't rely on byte-exact output across systems if you're piping `man` to `grep` for automation — use `man --no-justification` (Linux) or just read the section names.

WSL & PowerShell Core notes

pwsh`Get-Help` works on every pwsh — Windows / Linux / macOS — with the same syntax. Local help quality depends on `Update-Help` having been run (which requires internet). The community PSGallery modules each ship their own help; quality varies. On Linux / macOS pwsh, `& man <command>` still works for external Unix tools — `Get-Help` covers pwsh cmdlets, `man` covers external binaries. They coexist.
WSLWSL distros ship without man pages by default (Ubuntu WSL ships a minimal package set). `apt install man-db manpages` populates them. Once installed, `man grep` works exactly as on a native Linux box. Note WSL doesn't share man pages with Windows — Windows `Get-Help Select-String` and WSL `man grep` are independent docs in independent filesystems. For Windows-side from inside WSL, `pwsh.exe -Command "Get-Help Select-String"` works directly.

Related commands