Yenya's World

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!

Section: /computers (RSS feed) | Permanent link | 2 writebacks

2 replies for this story:

Adelton wrote: Not on F13

With man-1.6f-28.fc13.i686, I get man page for git and man page for log. Which version do you use?

Yenya wrote: Re: Not on F13

It is F14-only: man-db-2.5.7-7.fc14.x86_64

Reply to this story:

URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Key image: key image (valid for an hour only)
Key value: (to verify you are not a bot)


Yenya's World: Linux and beyond - Yenya's blog.


RSS feed

Jan "Yenya" Kasprzak

The main page of this blog



Blog roll:

alphabetically :-)