man — Display the manual page for a command across all 5 shells
Equivalents in every shell
man grepReads 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.
man grepSame 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.
man grepFish 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).
Get-Help Get-ChildItem -FullPowerShell'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.
<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`
man grepman grepman grepGet-Help Select-String -Fullfindstr /?Search for commands matching a keyword
man -k compress # or: apropos compressapropos compressman -k compressGet-Command -Verb CompresshelpOpen online docs in the browser
xdg-open "https://man7.org/linux/man-pages/man1/grep.1.html"open "x-man-page://grep"Get-Help Select-String -Onlinestart https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstrGotchas
- 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.