Can I get individual man pages for the bash builtin commands? [duplicate]












44
















This question already has an answer here:




  • Reading and searching long man pages

    9 answers




Is there anywhere you can download a manpage for every builtin commands?



I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man read and get the read manpage.










share|improve this question















marked as duplicate by Gilles, Anthon, jasonwryan, Braiam, slm Apr 7 '14 at 22:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • It's not quite what you want, but on my Fedora 15 system, these are separated into separate man pages which reference a builtins (1) man page. This is still a big aggregate document, but at least it's just the builtins and not everything to do with bash.

    – mattdm
    Aug 4 '11 at 20:45






  • 2





    Doesn't work in Mac OS X

    – Tyilo
    Aug 4 '11 at 20:49











  • Nor does man builtins work on linux mint.

    – suspectus
    Jan 29 '14 at 11:04






  • 1





    If all that you need is to know about a built in, Just use help <BuiltinName> -- Hope it helps those people like me annoyed on the failure of man and info with famous builtins. E.g. help command to know about the great yet less used command command. Finally as the question also hints, the help alone simply lists all possible builtins. (Verified on Ubuntu 16.04).

    – Loves Probability
    Nov 26 '16 at 5:13


















44
















This question already has an answer here:




  • Reading and searching long man pages

    9 answers




Is there anywhere you can download a manpage for every builtin commands?



I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man read and get the read manpage.










share|improve this question















marked as duplicate by Gilles, Anthon, jasonwryan, Braiam, slm Apr 7 '14 at 22:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • It's not quite what you want, but on my Fedora 15 system, these are separated into separate man pages which reference a builtins (1) man page. This is still a big aggregate document, but at least it's just the builtins and not everything to do with bash.

    – mattdm
    Aug 4 '11 at 20:45






  • 2





    Doesn't work in Mac OS X

    – Tyilo
    Aug 4 '11 at 20:49











  • Nor does man builtins work on linux mint.

    – suspectus
    Jan 29 '14 at 11:04






  • 1





    If all that you need is to know about a built in, Just use help <BuiltinName> -- Hope it helps those people like me annoyed on the failure of man and info with famous builtins. E.g. help command to know about the great yet less used command command. Finally as the question also hints, the help alone simply lists all possible builtins. (Verified on Ubuntu 16.04).

    – Loves Probability
    Nov 26 '16 at 5:13
















44












44








44


22







This question already has an answer here:




  • Reading and searching long man pages

    9 answers




Is there anywhere you can download a manpage for every builtin commands?



I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man read and get the read manpage.










share|improve this question

















This question already has an answer here:




  • Reading and searching long man pages

    9 answers




Is there anywhere you can download a manpage for every builtin commands?



I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man read and get the read manpage.





This question already has an answer here:




  • Reading and searching long man pages

    9 answers








bash man shell-builtin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 4 '11 at 20:46









mattdm

28.5k1172114




28.5k1172114










asked Aug 4 '11 at 20:39









TyiloTyilo

2,11873253




2,11873253




marked as duplicate by Gilles, Anthon, jasonwryan, Braiam, slm Apr 7 '14 at 22:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Gilles, Anthon, jasonwryan, Braiam, slm Apr 7 '14 at 22:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • It's not quite what you want, but on my Fedora 15 system, these are separated into separate man pages which reference a builtins (1) man page. This is still a big aggregate document, but at least it's just the builtins and not everything to do with bash.

    – mattdm
    Aug 4 '11 at 20:45






  • 2





    Doesn't work in Mac OS X

    – Tyilo
    Aug 4 '11 at 20:49











  • Nor does man builtins work on linux mint.

    – suspectus
    Jan 29 '14 at 11:04






  • 1





    If all that you need is to know about a built in, Just use help <BuiltinName> -- Hope it helps those people like me annoyed on the failure of man and info with famous builtins. E.g. help command to know about the great yet less used command command. Finally as the question also hints, the help alone simply lists all possible builtins. (Verified on Ubuntu 16.04).

    – Loves Probability
    Nov 26 '16 at 5:13





















  • It's not quite what you want, but on my Fedora 15 system, these are separated into separate man pages which reference a builtins (1) man page. This is still a big aggregate document, but at least it's just the builtins and not everything to do with bash.

    – mattdm
    Aug 4 '11 at 20:45






  • 2





    Doesn't work in Mac OS X

    – Tyilo
    Aug 4 '11 at 20:49











  • Nor does man builtins work on linux mint.

    – suspectus
    Jan 29 '14 at 11:04






  • 1





    If all that you need is to know about a built in, Just use help <BuiltinName> -- Hope it helps those people like me annoyed on the failure of man and info with famous builtins. E.g. help command to know about the great yet less used command command. Finally as the question also hints, the help alone simply lists all possible builtins. (Verified on Ubuntu 16.04).

    – Loves Probability
    Nov 26 '16 at 5:13



















It's not quite what you want, but on my Fedora 15 system, these are separated into separate man pages which reference a builtins (1) man page. This is still a big aggregate document, but at least it's just the builtins and not everything to do with bash.

– mattdm
Aug 4 '11 at 20:45





It's not quite what you want, but on my Fedora 15 system, these are separated into separate man pages which reference a builtins (1) man page. This is still a big aggregate document, but at least it's just the builtins and not everything to do with bash.

– mattdm
Aug 4 '11 at 20:45




2




2





Doesn't work in Mac OS X

– Tyilo
Aug 4 '11 at 20:49





Doesn't work in Mac OS X

– Tyilo
Aug 4 '11 at 20:49













Nor does man builtins work on linux mint.

– suspectus
Jan 29 '14 at 11:04





Nor does man builtins work on linux mint.

– suspectus
Jan 29 '14 at 11:04




1




1





If all that you need is to know about a built in, Just use help <BuiltinName> -- Hope it helps those people like me annoyed on the failure of man and info with famous builtins. E.g. help command to know about the great yet less used command command. Finally as the question also hints, the help alone simply lists all possible builtins. (Verified on Ubuntu 16.04).

– Loves Probability
Nov 26 '16 at 5:13







If all that you need is to know about a built in, Just use help <BuiltinName> -- Hope it helps those people like me annoyed on the failure of man and info with famous builtins. E.g. help command to know about the great yet less used command command. Finally as the question also hints, the help alone simply lists all possible builtins. (Verified on Ubuntu 16.04).

– Loves Probability
Nov 26 '16 at 5:13












2 Answers
2






active

oldest

votes


















25














Try this:



bashman () { man bash | less -p "^       $1 "; }


You may have to hit n a couple of times to get to the actual command instead of a paragraph that happens to have the command name as the first word.






share|improve this answer


























  • Good idea. Not what I think Tyilo wants, but I'm not convinced I got that right.

    – Gilles
    Aug 4 '11 at 23:32






  • 2





    Works perfect! Adding a space after $1 makes it better

    – Tyilo
    Aug 4 '11 at 23:35






  • 2





    You can also use LESS=-p"^ $1 " man bash. That way, you're not stripping any escape sequences.

    – user26112
    Jul 23 '13 at 1:03











  • You can also create a function that wraps around the original man function: function man() { local binman=/usr/bin/man; if ! $binman $1 &>/dev/null; then echo "No man entry for "$1"."; elif $binman bind | grep "BSD General Commands Manual" &>/dev/null; then LESS=-p"^ $1 " $binman bash; else $binman $1; fi; }.

    – Luke Davis
    Mar 16 '18 at 4:44













  • As I've explained here too this often does not work. As you stated, you often get to "a paragraph that happens to have the command name as the first word". As such, this question is not completely answered…

    – rugk
    Jan 23 at 15:23



















49














help read
help read | less


In zsh:



run-help read


or type read something and press M-h (i.e. Alt+h or ESC h).



If you want to have a single man command so as not to need to know whether the command is a built-in, define this function in your ~/.bashrc:



man () {
case "$(type -t "$1"):$1" in
builtin:*) help "$1" | "${PAGER:-less}";; # built-in
*[[?*]*) help "$1" | "${PAGER:-less}";; # pattern
*) command -p man "$@";; # something else, presumed to be an external command
# or options for the man command or a section number
esac
}





share|improve this answer


























  • type -t gives and empty string for a pattern. How does this work? *[[?*]* ?

    – balki
    Aug 24 '11 at 16:17











  • @balki type looks up an exact name. I don't think there's a way to look up a pattern, short of having a hard-coded list of built-ins and doing some complicated parsing of the output of alias, typeset -f and $PATH lookups.

    – Gilles
    Aug 24 '11 at 16:23











  • @spex No, I meant “i.e.”. It's followed by a complete list, not by some examples.

    – Gilles
    Jun 1 '17 at 20:05











  • @Gilles your list is not exhaustive and not universal, they are examples, thus e.g.

    – spex
    Jun 1 '17 at 21:51











  • run-help does display help for built-in, if it's not built-in it will open the man-page for that tool. Good tip.

    – sdkks
    Sep 3 '17 at 2:49


















2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









25














Try this:



bashman () { man bash | less -p "^       $1 "; }


You may have to hit n a couple of times to get to the actual command instead of a paragraph that happens to have the command name as the first word.






share|improve this answer


























  • Good idea. Not what I think Tyilo wants, but I'm not convinced I got that right.

    – Gilles
    Aug 4 '11 at 23:32






  • 2





    Works perfect! Adding a space after $1 makes it better

    – Tyilo
    Aug 4 '11 at 23:35






  • 2





    You can also use LESS=-p"^ $1 " man bash. That way, you're not stripping any escape sequences.

    – user26112
    Jul 23 '13 at 1:03











  • You can also create a function that wraps around the original man function: function man() { local binman=/usr/bin/man; if ! $binman $1 &>/dev/null; then echo "No man entry for "$1"."; elif $binman bind | grep "BSD General Commands Manual" &>/dev/null; then LESS=-p"^ $1 " $binman bash; else $binman $1; fi; }.

    – Luke Davis
    Mar 16 '18 at 4:44













  • As I've explained here too this often does not work. As you stated, you often get to "a paragraph that happens to have the command name as the first word". As such, this question is not completely answered…

    – rugk
    Jan 23 at 15:23
















25














Try this:



bashman () { man bash | less -p "^       $1 "; }


You may have to hit n a couple of times to get to the actual command instead of a paragraph that happens to have the command name as the first word.






share|improve this answer


























  • Good idea. Not what I think Tyilo wants, but I'm not convinced I got that right.

    – Gilles
    Aug 4 '11 at 23:32






  • 2





    Works perfect! Adding a space after $1 makes it better

    – Tyilo
    Aug 4 '11 at 23:35






  • 2





    You can also use LESS=-p"^ $1 " man bash. That way, you're not stripping any escape sequences.

    – user26112
    Jul 23 '13 at 1:03











  • You can also create a function that wraps around the original man function: function man() { local binman=/usr/bin/man; if ! $binman $1 &>/dev/null; then echo "No man entry for "$1"."; elif $binman bind | grep "BSD General Commands Manual" &>/dev/null; then LESS=-p"^ $1 " $binman bash; else $binman $1; fi; }.

    – Luke Davis
    Mar 16 '18 at 4:44













  • As I've explained here too this often does not work. As you stated, you often get to "a paragraph that happens to have the command name as the first word". As such, this question is not completely answered…

    – rugk
    Jan 23 at 15:23














25












25








25







Try this:



bashman () { man bash | less -p "^       $1 "; }


You may have to hit n a couple of times to get to the actual command instead of a paragraph that happens to have the command name as the first word.






share|improve this answer















Try this:



bashman () { man bash | less -p "^       $1 "; }


You may have to hit n a couple of times to get to the actual command instead of a paragraph that happens to have the command name as the first word.







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 5 '11 at 13:18

























answered Aug 4 '11 at 23:10









glenn jackmanglenn jackman

51.2k571110




51.2k571110













  • Good idea. Not what I think Tyilo wants, but I'm not convinced I got that right.

    – Gilles
    Aug 4 '11 at 23:32






  • 2





    Works perfect! Adding a space after $1 makes it better

    – Tyilo
    Aug 4 '11 at 23:35






  • 2





    You can also use LESS=-p"^ $1 " man bash. That way, you're not stripping any escape sequences.

    – user26112
    Jul 23 '13 at 1:03











  • You can also create a function that wraps around the original man function: function man() { local binman=/usr/bin/man; if ! $binman $1 &>/dev/null; then echo "No man entry for "$1"."; elif $binman bind | grep "BSD General Commands Manual" &>/dev/null; then LESS=-p"^ $1 " $binman bash; else $binman $1; fi; }.

    – Luke Davis
    Mar 16 '18 at 4:44













  • As I've explained here too this often does not work. As you stated, you often get to "a paragraph that happens to have the command name as the first word". As such, this question is not completely answered…

    – rugk
    Jan 23 at 15:23



















  • Good idea. Not what I think Tyilo wants, but I'm not convinced I got that right.

    – Gilles
    Aug 4 '11 at 23:32






  • 2





    Works perfect! Adding a space after $1 makes it better

    – Tyilo
    Aug 4 '11 at 23:35






  • 2





    You can also use LESS=-p"^ $1 " man bash. That way, you're not stripping any escape sequences.

    – user26112
    Jul 23 '13 at 1:03











  • You can also create a function that wraps around the original man function: function man() { local binman=/usr/bin/man; if ! $binman $1 &>/dev/null; then echo "No man entry for "$1"."; elif $binman bind | grep "BSD General Commands Manual" &>/dev/null; then LESS=-p"^ $1 " $binman bash; else $binman $1; fi; }.

    – Luke Davis
    Mar 16 '18 at 4:44













  • As I've explained here too this often does not work. As you stated, you often get to "a paragraph that happens to have the command name as the first word". As such, this question is not completely answered…

    – rugk
    Jan 23 at 15:23

















Good idea. Not what I think Tyilo wants, but I'm not convinced I got that right.

– Gilles
Aug 4 '11 at 23:32





Good idea. Not what I think Tyilo wants, but I'm not convinced I got that right.

– Gilles
Aug 4 '11 at 23:32




2




2





Works perfect! Adding a space after $1 makes it better

– Tyilo
Aug 4 '11 at 23:35





Works perfect! Adding a space after $1 makes it better

– Tyilo
Aug 4 '11 at 23:35




2




2





You can also use LESS=-p"^ $1 " man bash. That way, you're not stripping any escape sequences.

– user26112
Jul 23 '13 at 1:03





You can also use LESS=-p"^ $1 " man bash. That way, you're not stripping any escape sequences.

– user26112
Jul 23 '13 at 1:03













You can also create a function that wraps around the original man function: function man() { local binman=/usr/bin/man; if ! $binman $1 &>/dev/null; then echo "No man entry for "$1"."; elif $binman bind | grep "BSD General Commands Manual" &>/dev/null; then LESS=-p"^ $1 " $binman bash; else $binman $1; fi; }.

– Luke Davis
Mar 16 '18 at 4:44







You can also create a function that wraps around the original man function: function man() { local binman=/usr/bin/man; if ! $binman $1 &>/dev/null; then echo "No man entry for "$1"."; elif $binman bind | grep "BSD General Commands Manual" &>/dev/null; then LESS=-p"^ $1 " $binman bash; else $binman $1; fi; }.

– Luke Davis
Mar 16 '18 at 4:44















As I've explained here too this often does not work. As you stated, you often get to "a paragraph that happens to have the command name as the first word". As such, this question is not completely answered…

– rugk
Jan 23 at 15:23





As I've explained here too this often does not work. As you stated, you often get to "a paragraph that happens to have the command name as the first word". As such, this question is not completely answered…

– rugk
Jan 23 at 15:23













49














help read
help read | less


In zsh:



run-help read


or type read something and press M-h (i.e. Alt+h or ESC h).



If you want to have a single man command so as not to need to know whether the command is a built-in, define this function in your ~/.bashrc:



man () {
case "$(type -t "$1"):$1" in
builtin:*) help "$1" | "${PAGER:-less}";; # built-in
*[[?*]*) help "$1" | "${PAGER:-less}";; # pattern
*) command -p man "$@";; # something else, presumed to be an external command
# or options for the man command or a section number
esac
}





share|improve this answer


























  • type -t gives and empty string for a pattern. How does this work? *[[?*]* ?

    – balki
    Aug 24 '11 at 16:17











  • @balki type looks up an exact name. I don't think there's a way to look up a pattern, short of having a hard-coded list of built-ins and doing some complicated parsing of the output of alias, typeset -f and $PATH lookups.

    – Gilles
    Aug 24 '11 at 16:23











  • @spex No, I meant “i.e.”. It's followed by a complete list, not by some examples.

    – Gilles
    Jun 1 '17 at 20:05











  • @Gilles your list is not exhaustive and not universal, they are examples, thus e.g.

    – spex
    Jun 1 '17 at 21:51











  • run-help does display help for built-in, if it's not built-in it will open the man-page for that tool. Good tip.

    – sdkks
    Sep 3 '17 at 2:49
















49














help read
help read | less


In zsh:



run-help read


or type read something and press M-h (i.e. Alt+h or ESC h).



If you want to have a single man command so as not to need to know whether the command is a built-in, define this function in your ~/.bashrc:



man () {
case "$(type -t "$1"):$1" in
builtin:*) help "$1" | "${PAGER:-less}";; # built-in
*[[?*]*) help "$1" | "${PAGER:-less}";; # pattern
*) command -p man "$@";; # something else, presumed to be an external command
# or options for the man command or a section number
esac
}





share|improve this answer


























  • type -t gives and empty string for a pattern. How does this work? *[[?*]* ?

    – balki
    Aug 24 '11 at 16:17











  • @balki type looks up an exact name. I don't think there's a way to look up a pattern, short of having a hard-coded list of built-ins and doing some complicated parsing of the output of alias, typeset -f and $PATH lookups.

    – Gilles
    Aug 24 '11 at 16:23











  • @spex No, I meant “i.e.”. It's followed by a complete list, not by some examples.

    – Gilles
    Jun 1 '17 at 20:05











  • @Gilles your list is not exhaustive and not universal, they are examples, thus e.g.

    – spex
    Jun 1 '17 at 21:51











  • run-help does display help for built-in, if it's not built-in it will open the man-page for that tool. Good tip.

    – sdkks
    Sep 3 '17 at 2:49














49












49








49







help read
help read | less


In zsh:



run-help read


or type read something and press M-h (i.e. Alt+h or ESC h).



If you want to have a single man command so as not to need to know whether the command is a built-in, define this function in your ~/.bashrc:



man () {
case "$(type -t "$1"):$1" in
builtin:*) help "$1" | "${PAGER:-less}";; # built-in
*[[?*]*) help "$1" | "${PAGER:-less}";; # pattern
*) command -p man "$@";; # something else, presumed to be an external command
# or options for the man command or a section number
esac
}





share|improve this answer















help read
help read | less


In zsh:



run-help read


or type read something and press M-h (i.e. Alt+h or ESC h).



If you want to have a single man command so as not to need to know whether the command is a built-in, define this function in your ~/.bashrc:



man () {
case "$(type -t "$1"):$1" in
builtin:*) help "$1" | "${PAGER:-less}";; # built-in
*[[?*]*) help "$1" | "${PAGER:-less}";; # pattern
*) command -p man "$@";; # something else, presumed to be an external command
# or options for the man command or a section number
esac
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 1 '17 at 20:02

























answered Aug 4 '11 at 20:50









GillesGilles

533k12810731594




533k12810731594













  • type -t gives and empty string for a pattern. How does this work? *[[?*]* ?

    – balki
    Aug 24 '11 at 16:17











  • @balki type looks up an exact name. I don't think there's a way to look up a pattern, short of having a hard-coded list of built-ins and doing some complicated parsing of the output of alias, typeset -f and $PATH lookups.

    – Gilles
    Aug 24 '11 at 16:23











  • @spex No, I meant “i.e.”. It's followed by a complete list, not by some examples.

    – Gilles
    Jun 1 '17 at 20:05











  • @Gilles your list is not exhaustive and not universal, they are examples, thus e.g.

    – spex
    Jun 1 '17 at 21:51











  • run-help does display help for built-in, if it's not built-in it will open the man-page for that tool. Good tip.

    – sdkks
    Sep 3 '17 at 2:49



















  • type -t gives and empty string for a pattern. How does this work? *[[?*]* ?

    – balki
    Aug 24 '11 at 16:17











  • @balki type looks up an exact name. I don't think there's a way to look up a pattern, short of having a hard-coded list of built-ins and doing some complicated parsing of the output of alias, typeset -f and $PATH lookups.

    – Gilles
    Aug 24 '11 at 16:23











  • @spex No, I meant “i.e.”. It's followed by a complete list, not by some examples.

    – Gilles
    Jun 1 '17 at 20:05











  • @Gilles your list is not exhaustive and not universal, they are examples, thus e.g.

    – spex
    Jun 1 '17 at 21:51











  • run-help does display help for built-in, if it's not built-in it will open the man-page for that tool. Good tip.

    – sdkks
    Sep 3 '17 at 2:49

















type -t gives and empty string for a pattern. How does this work? *[[?*]* ?

– balki
Aug 24 '11 at 16:17





type -t gives and empty string for a pattern. How does this work? *[[?*]* ?

– balki
Aug 24 '11 at 16:17













@balki type looks up an exact name. I don't think there's a way to look up a pattern, short of having a hard-coded list of built-ins and doing some complicated parsing of the output of alias, typeset -f and $PATH lookups.

– Gilles
Aug 24 '11 at 16:23





@balki type looks up an exact name. I don't think there's a way to look up a pattern, short of having a hard-coded list of built-ins and doing some complicated parsing of the output of alias, typeset -f and $PATH lookups.

– Gilles
Aug 24 '11 at 16:23













@spex No, I meant “i.e.”. It's followed by a complete list, not by some examples.

– Gilles
Jun 1 '17 at 20:05





@spex No, I meant “i.e.”. It's followed by a complete list, not by some examples.

– Gilles
Jun 1 '17 at 20:05













@Gilles your list is not exhaustive and not universal, they are examples, thus e.g.

– spex
Jun 1 '17 at 21:51





@Gilles your list is not exhaustive and not universal, they are examples, thus e.g.

– spex
Jun 1 '17 at 21:51













run-help does display help for built-in, if it's not built-in it will open the man-page for that tool. Good tip.

– sdkks
Sep 3 '17 at 2:49





run-help does display help for built-in, if it's not built-in it will open the man-page for that tool. Good tip.

– sdkks
Sep 3 '17 at 2:49



Popular posts from this blog

How to make a Squid Proxy server?

第一次世界大戦

Touch on Surface Book