For example, when I type man fg
, or man history
, the same manpage, BUILTIN(1)
will be displayed. There is a list of commands, but not the specification of their usage. Where can I find them?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
BUILTIN
commands don't have separate man pages. Those are covered by help
pages. You can do:
help history
or
help fg
回答2:
I have the following bash function defined in my ~/.bashrc:
bashman ()
{
man bash | less -p "^ $1 "
}
This allows me to (in most cases) jump directly to the relevant section of the bash man page for the given builtin. E.g.
bashman fg
jumps directly to:
fg [jobspec]
Resume jobspec in the foreground, and make it the current job.
If jobspec is not present, the shell's notion of the current job
...
Unfortunately it doesn't work quite so well for some builtins - history
is one of them. In those cases, you will have to n through the man page several times to get to the required section.
回答3:
Documentation for commands that are shell builtins are with the man pages for the shell.
See for example: man bash for the history or fg command.