Some Linux commands may not have manual pages. This brief guide gives you a quick fix to install missing man pages of commands on Ubuntu and its derivatives.
The other day I was testing alias and unalias commands on my Ubuntu desktop. I wanted to refer all available arguments, flags and options of the
alias command, so I opened the man page.
But, it turns out both commands doesn't have manual pages.
$ man alias No manual entry for alias
$ man unalias No manual entry for unalias
The man pages are also missing for some other programs, such as
There is no other way except googling to learn about these programs.
On RPM-based systems(E.g. CentOS), if you run
"man alias" command, it will open man pages for BASH BUILTINS. You may need to go through the whole man page to find details of the respective command.
After a bit of Google search, I learned that there is no dedicated manual pages for shell builtins, like alias, export, eval in Linux Programmer's manual.
If you're not sure whether the given command is an alias, shell built-in, file, function, or keyword, use type command to find out.
$ type alias alias is a shell builtin
The documentation for these builtins are available in the related shell man page. As you can see in the above output, alias is a shell builtin, so you can view the documentation in the associated shell man page. In my case, it is BASH.
Let us open the man pages of BASH:
$ man bash
Search for alias or unalias entries in the Bash man page.
Here is the information of alias and unalias:
Heads Up: Having trouble at finding something in the man pages? Refer the following guide.
View shell builtins information using "help" command
Alternatively, you can get the information of shell builtins using
help command like below.
$ help alias
alias: alias [-p] [name[=value] ... ] Define or display aliases. Without arguments, `alias' prints the list of aliases in the reusable form `alias NAME=VALUE' on standard output. Otherwise, an alias is defined for each NAME whose VALUE is given. A trailing space in VALUE causes the next word to be checked for alias substitution when the alias is expanded. Options: -p print all defined aliases in a reusable format Exit Status: alias returns true unless a NAME is supplied for which no alias has been defined.
If you prefer man page format, simply use
-m flag with help command below.
$ help -m alias
All bash builtins have help pages. Even
help command itself has a help page.
$ help help help: help [-dms] [pattern ...] Display information about builtin commands. Displays brief summaries of builtin commands. If PATTERN is specified, gives detailed help on all commands matching PATTERN, otherwise the list of help topics is printed. Options: -d output short description for each topic -m display usage in pseudo-manpage format -s output only a short usage synopsis for each topic matching PATTERN Arguments: PATTERN Pattern specifiying a help topic Exit Status: Returns success unless PATTERN is not found or an invalid option is given.
This is how you can find the information of shell builtins.
Now, let us get back to the topic. Is there any way to install missing man pages of commands? That's what we are going to do now.
Install missing man pages of commands on Ubuntu
As stated earlier, Builtins are part of the shell. Each shell has its own set of builtins. They are not independent commands and they don't have separate man pages.
Luckily, the man pages of shell builtins are available in POSIX Programmer's Manual. You need to install it to access those man pages.
On Debian, Ubuntu and other DEB-based systems, simply run the following command to install POSIX Programmer's Manual:
$ sudo apt install manpages-posix
Now, you can access the man pages of a shell builtin (E.g. alias) using command:
$ man alias
Hope this helps.