Fri, 25 Mar 2011
man(1) Surprise
Hello, this is your editor speaking, welcome to the "lesser known Linux feature
of the day" series. Today we will cover an interesting feature
of man(1)
that your editor has just ran into. Try running
the following command:
$ man git log
The manual page of git-log(1)
is displayed on my Fedora 14 system.
How does man
know that git
provides a "log
" sub-command in addition to the equivalent
git-log
standalone command?
The man page says:
By default, man will try to interpret pairs of manual page names given on the command line as equivalent to a single manual page name containing a hyphen. This supports the common pattern of programs that implement a number of subcommands, allowing them to provide manual pages for each that can be accessed using similar syntax as would be used to invoke the subcommands themselves.
And it even goes into an example using - guess what - git. That's all for today, see you next time!