How can I easily see the man page for builtin shell commands?

jhabbott

If I see a command in a script that I don't know and I type (for example) man pushd or man umask I see the man page for builtin commands. I know that I can do man bash and scroll to find the help for that builtin command, or I can open a browser and go to the online bash man page which is easier to search, but is there an easier way to get the man page for a single builtin command directly on the command line?

mpy

Perhaps you like to have some wrapper function which skips directly to the builtin:

man -P "less +/\ \ \ pushd" bash

-P tells man to use less as pager (probably the default on most systems), but pass directly a search to it. You need to add some blanks before the search string to skip hits in text and go to the description of the command.

For convenience make a function out of it and put it into your ~/.bashrc:

function manbash {
   man -P "less +/\ \ \ $1" bash
}

and use it like manbash pushd.


Another possibility is to use the bash builtin help:

$ help pushd
pushd: pushd [-n] [+N | -N | dir]
Add directories to stack.

Adds a directory to the top of the directory stack, or rotates
the stack, making the new top of the stack the current working
directory.  With no arguments, exchanges the top two directories.

Options:
[...]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to make `man` work for shell builtin commands and keywords?

From Dev

How to make `man` work for shell builtin commands and keywords?

From Dev

How do I list all available shell builtin commands?

From Dev

How do I list all available shell builtin commands?

From Dev

How can I easily crop a PDF page?

From Dev

Understanding shell builtin commands

From Dev

How can I create new shell commands?

From Dev

How can I see a history of the terminal output, not just commands entered?

From Dev

How can I easily and efficiently see the available components provided by Angular dependencies?

From Dev

How to see the commands executed in another shell?

From Dev

How to see the commands executed in another shell?

From Dev

How can I easily make my own custom setup.py commands?

From Dev

How can I see the verbatim contents of a shell variable?

From Dev

How can I call builtin functions that aren't builtin?

From Dev

How can I set up short forms for commands on Unix shell?

From Dev

How can I set up short forms for commands on Unix shell?

From Dev

How can I visually select, then execute shell commands directly in vim?

From Dev

How can I send multiple commands' output to a single shell pipeline?

From Dev

How do I write a shell script to issue commands and see the output on the screen

From Dev

How do I write a shell script to issue commands and see the output on the screen

From Dev

How can I see the Microsoft Edge start page in another browser?

From Dev

How can I mock builtin `require` function?

From Dev

How can I superclass a builtin class?

From Dev

Where to view man pages for Bash builtin commands?

From Dev

Where to view man pages for Bash builtin commands?

From Dev

How can I search the APT man page for options to install

From Dev

How can I easily encrypt a file?

From Dev

How can i make a new array easily?

From Dev

How can I easily encrypt a file?

Related Related

  1. 1

    How to make `man` work for shell builtin commands and keywords?

  2. 2

    How to make `man` work for shell builtin commands and keywords?

  3. 3

    How do I list all available shell builtin commands?

  4. 4

    How do I list all available shell builtin commands?

  5. 5

    How can I easily crop a PDF page?

  6. 6

    Understanding shell builtin commands

  7. 7

    How can I create new shell commands?

  8. 8

    How can I see a history of the terminal output, not just commands entered?

  9. 9

    How can I easily and efficiently see the available components provided by Angular dependencies?

  10. 10

    How to see the commands executed in another shell?

  11. 11

    How to see the commands executed in another shell?

  12. 12

    How can I easily make my own custom setup.py commands?

  13. 13

    How can I see the verbatim contents of a shell variable?

  14. 14

    How can I call builtin functions that aren't builtin?

  15. 15

    How can I set up short forms for commands on Unix shell?

  16. 16

    How can I set up short forms for commands on Unix shell?

  17. 17

    How can I visually select, then execute shell commands directly in vim?

  18. 18

    How can I send multiple commands' output to a single shell pipeline?

  19. 19

    How do I write a shell script to issue commands and see the output on the screen

  20. 20

    How do I write a shell script to issue commands and see the output on the screen

  21. 21

    How can I see the Microsoft Edge start page in another browser?

  22. 22

    How can I mock builtin `require` function?

  23. 23

    How can I superclass a builtin class?

  24. 24

    Where to view man pages for Bash builtin commands?

  25. 25

    Where to view man pages for Bash builtin commands?

  26. 26

    How can I search the APT man page for options to install

  27. 27

    How can I easily encrypt a file?

  28. 28

    How can i make a new array easily?

  29. 29

    How can I easily encrypt a file?

HotTag

Archive