I know that these command will help to get syntax and options for commands but my question is that how they differ from each other?
3 Answers
help is a built-in command in the bash shell (and that shell only) that documents some of the builtin commands and keywords of that shell. That's an internal documentation system of that shell. Other shells have their own documentation system (ksh93 has --help and --man options for its builtins, zsh has a run-help helper that extracts information from manuals in other formats). Other commands like vim have their own embedded documentation system.
man is a system-wide documentation system that provides short reference manuals (pages) for individual commands, API functions, concepts, configuration file syntax, file formats organised in sections (1 for user commands, 2 for system calls...). That's the traditional Unix documentation system.
info is another documentation system originating in the GNU project. It's hypertext with links (predates the web). An info manual is like a digital book with a concept of table of contents and (searchable) index which helps locating the information.
There's overlap between the 3. For instance, bash being part of the GNU project has both a man page and an info manual. The size of the manual makes the man system not as appropriate for bash though. However, the structure of the info manual and index is not very good in bash which makes it not as easy to look information in as in other info manuals like zsh's. zsh manual being even bigger is split into several man pages and also has a good info manual with a very good index.
It should be noted that the info manual is generated from a texinfo format which is also used to generate HTML and printable (PDF/PS) versions. In the case of zsh though, the texinfo is generated from another format (yodl).
- 4This is the best answer, congratulations. The accepted one is too terse to be useful, given the general nature of the question.neuronet– neuronet2016-06-10 14:22:39 +00:00Commented Jun 10, 2016 at 14:22
- also useful:
help help; not useful:man help.De Novo– De Novo2018-10-25 07:59:09 +00:00Commented Oct 25, 2018 at 7:59 - 2@DeNovo, yes, since
helpis a builtin ofbash. More useful:info bash help.Stéphane Chazelas– Stéphane Chazelas2018-10-25 08:15:30 +00:00Commented Oct 25, 2018 at 8:15 - 1Note that many GNU (and other) programs mangle/summarize the
*.texi(i.e.,info) documentation intomanpages.vonbrand– vonbrand2021-05-13 11:22:49 +00:00Commented May 13, 2021 at 11:22
help is a bash built-in, providing help for bash commands only
man is the traditional form of help for almost every command on your system, and not only, sometimes also configuration files have their own man page. In Linux distros organized in packages, the relative text is in general provided from the same package providing the command. If you have bash-completion you can take advantage from TAB to see what man pages are available.
info is an alternative system to provide manual pages for commands, based on GNU emacs. It is provided mainly for GNU commands and utilities. It don't seem to be widely adopted from others.
help is a bash command. It uses internal bash structures to store and retrieve information about bash commands.
man is a macro set for the troff (via groff) processor. The output of processing a single file is sent to a pager by the man command by default.
info is a text-only viewer for archives in the info format output of Texinfo.
- 8man is more than a "macro set for the troff processor". -1 for this answer.fpmurphy– fpmurphy2011-08-26 14:06:53 +00:00Commented Aug 26, 2011 at 14:06
- 1@fpmurphy: Not by much.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2011-08-26 20:05:48 +00:00Commented Aug 26, 2011 at 20:05
- 12This explains very little.Ankur S– Ankur S2018-05-09 20:08:27 +00:00Commented May 9, 2018 at 20:08
- 1This explanation is too simple compared to others.smwikipedia– smwikipedia2021-09-21 02:42:58 +00:00Commented Sep 21, 2021 at 2:42