Why are there about four different ways of getting help or documentation about a command in Linux software?
What are the differences between
man x
help x
info x
x --help
(orx -h
)
(where x
stands for the command / software)?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityman
is the historical unix documentation system. "manpages" come in Troff-formatted text files, that you'll find in /usr/share/man
. Traditionally, it's more a reminder help for experts than a full-fledged documentation.help
is a shell built-in command. It provides some help about well, shell built-in commands.info
is the documentation system from the GNU project. It's quite similar to man, but comes with hyperlinks (so you can navigate from one documentation to another, like HTML files). It didn't really get much traction out of the GNU world, most Linux programs man and info pages come with the same text.
However, GNU programs (GNU tar, GNU Emacs, etc) comes with an extremely comprehensive "info" documentation.x -h
or x --help
is the usual way to ask a program for some basic help, like x /?
in the DOS/Windows world. It's part of the most basic development good practice to manage properly these switches.x -h
or x --help
: the program x
itself produces the output.
man
or info
are themselves programs that display info from a text library. (see wazoox answer for good info.
help
: never heard of. Probably an obsolete bash
-builtin.