Results 1 to 7 of 7
This is really bugging me and I'm sure the answer is so trivial!
Using the command line help, or manuals, it sometimes shows a number in parentheses immediately after a ...
- 04-26-2009 #1Just Joined!
- Join Date
- Apr 2009
- Location
- South East England
- Posts
- 40
Trouble RTFM
This is really bugging me and I'm sure the answer is so trivial!
Using the command line help, or manuals, it sometimes shows a number in parentheses immediately after a command - is this simply some sort of reference number? I thought at first it was telling me something about parameters I had to pass in!
For instance looking at the Git manual page, it shows ...
git(1) Manual Page
... and then further down looking at the sub commands it has stuff like ...
git-add(1)
git-branch(1)
etc, etc
I'm pretty sure I've seen this help syntax on stuff other than Git, and the number in brackets is not always 1.
It would be useful to know what this is on about please.
- 04-26-2009 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
Manpages are grouped into sections. The number refers to the section number. A command can be in more than one section so the 'man' command allows you specify the section. In your example,
git-branch(1)
you could look at the manpage with:
# man 1 git-branch
- 04-26-2009 #3Just Joined!
- Join Date
- Apr 2009
- Location
- Alabama
- Posts
- 5
If you do a 'man man' it will give you a man of the man itself. In there, you will see all of the available section numbers (under the Description heading) as well as all the man information you could ever want.
- 04-26-2009 #4Just Joined!
- Join Date
- Apr 2009
- Location
- South East England
- Posts
- 40
Never occured to me to try man man! Nor that the same command might be in multiple sections of the manual. All makes sense now.
Many thanks.
- 04-26-2009 #5
In most cases, it isn't actually the same command in multiple sections. Instead, it's things that are named the same. For instance, printf(1) is the printf program that you run from the shell. printf(3), on the other hand, is the printf function that is a part of the standard C library.
You can use "man -k TERM" to see every man page with that term in the title, and choose the appropriate one.DISTRO=Arch
Registered Linux User #388732
- 04-26-2009 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
Well, there are some system commands that have the same name as library functions. Each will be in a different section, so if you just execute "man printf", you will get the printf page from section 1 which is a system command to be used in shell scripts, but if you want the C API printf() man page, you would use "man 3 printf". Two very different beasts!
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-27-2009 #7Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228


Reply With Quote
