GICT knowledge base
Linux man command
Published
The man pages are interface to the on-line reference manuals and man command is used to format and display the man pages. The man pages are a user manual that is built by default into most Linux distributions and other Unix-like operating systems during installation. Man pages come from various sources and although most of them are similar, it can be contain tables, mathematical equations, and bibliographic references. Man pages are the work result of so many people doing their best to describe the commands and their usage. Manual pages are not designed to be a help system, but they do provide descriptions of the commands themselves. You have to know which page to look for or know how to search for the correct page. Manual pages aren’t designed to be a tutorial on how to use the commands. They are a reference that frequently explains how the command functions, so that you can easily understand its use. There is usually help available from the commands themselves by executing the command with the “–help” option. Try typing in ls –help. Beginners are encouraged to type ls –help | less.
Sections of the Linux manual
The man pages are originated from the historical Linux Programmer’s manual. Each manual contains information for specific types of files which have become the sections listed below.
Section Content Type
1 User Commands (both executable and shell programs)
2 System calls (kernel routines invoked from user space)
3 Library functions (provided by program libraries)
4 Special files (such as device files)
5 File formats (for many configuration files and structures)
6 Game (historical section for amusing programs)
7 Conventions, standards, and miscellaneous (protocols, file systems)
8 System administration and privileged commands (maintenance tasks)
9 Linux kernel API (internal kernel calls)
To distinguish identical topic names in different sections, man page references include the section number in parentheses after the topic. For example, passwd(1) describes the command to change passwords, while passwd(5) explains the /etc/passwd file format for storing local user accounts. To read specific man pages, use man topic. Topic contents display one screen at a time. Use arrow keys for single line scrolling or the space bar for next screen. The man command searches manual sections in a configured order, displaying popular sections first. For example, man passwd displays passwd(1) by default . To display the man page topic from a specific section, include the section number argument: man 5 passwd displays passwd(5).
Searching for man pages by keyword
A keyword search of man pages is performed using man -k keyword, which displays a list of keyword-matching man page topics with section numbers.
kubuntu@vm:~$ man -k passwd
chgpasswd (8) – update group passwords in batch mode
chpasswd (8) – update passwords in batch mode
gpasswd (1) – administer /etc/group and /etc/gshadow
grub-mkpasswd-pbkdf2 (1) – generate hashed password for GRUB
lppasswd (1) – add, change, or delete digest passwords.
mkpasswd (1) – Overfeatured front end to crypt(3)
pam_localuser (8) – require users to be listed in /etc/passwd
passwd (1) – change user password
passwd (1ssl) – compute password hashes
passwd (5) – the password file
smbpasswd (5) – The Samba encrypted password file
smbpasswd (8) – change a user’s SMB password
update-passwd (8) – safely update /etc/passwd, /etc/shadow and /etc/group
kubuntu@vm:~$
Popular system administration topics are in sections 1 (user commands), 5 (file formats), and 8 (administrative commands). Administrators using certain troubleshooting tools also use section 2 (system calls). The remaining sections are commonly for programmer reference or advanced administration. Keyword searches relay on an index generated by the mandb(8) command, which must be run as root. The command runs through cron.daily, or anacrontab within an hour of boot if out of date. The man command ‘-K’ option performs full-text page search, not just titles and descriptions like the ‘-k’. A full-text search can use greater systems resources and take more time.
Examples of man command
The following command provides the information about the ‘ls’ command.
# man ls
The following displays the man page about the ‘man pages’.
# man man
To display the manual page for the ‘cp’ (copy files) command use the below command.
# man cp
If you need any further assistance please contact our support department.
Related guides
How to Restrict an SSH Key to One Command
Restrict an SSH key to one command with authorized_keys options. Protect the command and check that unwanted shell and forwarding access are denied.
Linux and CommandsSelf-Hosted Video Processing With FFmpeg: A Practical Guide
Learn how to self-host video processing on a VPS using FFmpeg, with practical commands for conversion, compression, thumbnails, and automated workflows.
Linux and CommandsHow to use nohup: Commands in Linux That Survive Terminal Closes
Keep commands running after you close the terminal. nohup examples with wget, Python, rsync, and Docker on any VPS.
Linux and CommandsHow to Fix “Too Many Open Files” Error on Linux Servers
Learn how to fix the "Too Many Open Files" error on Linux servers by understanding file descriptors, adjusting limits, and diagnosing leaks effectively.
