The man command used to display the on-line manual pages on Alpine Linux. The man page(s) may not be installed to save disk space, especially on Linux containers. Here is the quick and easy command option to install man command and man pages in Alpine Linux.
How to get man pages working in Alpine Linux
Type the following apk command to install man pages:
# apk add man man-pages
## NOTE: If you are using Alpine Linux 3.12 or above try ##
# apk add mandoc man-pages
Fig.01: Installing man pages in Alpine Linux with apk command
Suggested command to get man pages installed on Alpine
Run:
# apk add man man-pages mdocml-apropos less less-doc
## NOTE: Alpine Linux 3.12 or above user try the following ##
# apk add mandoc man-pages mdocml-apropos less less-doc
Sample outputs:
(1/6) Installing less (551-r0) (2/6) Installing less-doc (551-r0) (3/6) Installing mdocml (1.14.3-r3) (4/6) Installing man (1.14.3-r3) (5/6) Installing man-pages (5.01-r0) (6/6) Installing mdocml-apropos (1.14.3-r3) Executing busybox-1.30.1-r2.trigger Executing mdocml-apropos-1.14.3-r3.trigger OK: 112 MiB in 95 packages
Examples
To display man page use the following simple syntax:
man command
man {section} command-name
Each man page comes in sections. The table below shows the section numbers of the manual followed by the types of pages they contain:
Man page section | Description |
---|---|
1 | User command (executable programs or shell commands) |
2 | System calls (functions provided by the kernel) |
3 | Library calls (functions within program libraries) |
4 | Special files (usually found in /dev) |
5 | File formats and conventions eg /etc/passwd |
6 | Games |
7 | Miscellaneous (including macro packages and conventions), |
8 | System administration commands (usually only for root user) |
9 | Kernel routines [Non standard] |
For example, to display ls command man page, enter:
$ man ls
Let us see the password (/etc/passwd) file man page format from section # 5:
$ man 5 passwd
See how to install man pages on a Ubuntu Linux.
How do I search for man pages packages?
The above command only installs core man pages on Alpine Linux. Other packages typically may not include their man pages or other documentation. Those packages might provide an associated package that carries such stuff. For example, nginx server installed on Alpine but man page is not installed by default:
$ man nginx
Sample outputs:
man: No entry for nginx in the manual.
One can search for documentation package using the combination of apk command and grep command as follows:
apk search nginx | grep -- -doc
Sample outputs:
perl-test-nginx-doc-0.26-r0 nginx-doc-1.16.1-r0
Now you can install nginx-doc package, run:
# apk add nginx-doc
(1/1) Installing nginx-doc (1.16.1-r0) Executing mdocml-apropos-1.14.3-r3.trigger OK: 112 MiB in 96 packages
Test it:
man nginx
How to set up PAGER variable to less or most or more
The command line syntax for bash/sh is:
export PAGER=less
OR if you have most command installed:
export PAGER=most
Make sure you add it to your shell config file (make sure you install bash shell on Alpine Linux or adjust settings as per your shell):
echo 'export PAGER=less' >> $HOME/.bashrc
Conclusion
This page explained how to install man pages in Alpine Linux. For more information, see the official project home page
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |