man

man is a system utility built into Linux that uses a pager such as less to display manual files stored in /usr/share/man/. It’s useful to display command options with detailed descriptions of what they do. There are 9 sections total, though not all commands will have content in each section – a lot of commands have content in sections 1, 5, and 8.

#aprapos #info #pinfo

Basic Syntax

man [option] command

Man Page Sections

Section Number Description
1 User Commands – Commands that can be run by regular users, typically executed from a shell
2 System Calls – Functions provided by the kernel
3 Library Functions – Functions within program libraries
4 Devices and Special Files – Device drivers and special files
5 File Formats and Conventions – File formats and configuration file syntax
6 Games – Games that can be run on the system
7 Miscellaneous – Topics that don’t fit into other sections
8 System Administration Commands – Commands for system administrators, typically need root access
9 Kernel Interface – Kernel internal functions and structures

Commonly Used Options

  • -f: This displays the one-line description of the specified command.
  • -k: This searches the manual page descriptions for the specified keyword.
  • -w: This displays the location of the manual page for the specified command, but does not display the page itself.
  • -S: This specifies the colon-separated list of directories to search for manual pages.
  • -a: This displays all manual pages matching the specified name, in all available sections.

Example Usage

  • man useradd: This displays the manual page for the useradd command in section 1.
  • man 2 read: This displays the manual page for the read system call in section 2.
  • man printf: This displays the manual page for the printf C library function in section 3.
  • man 5 passwd: This displays the manual page for the passwd file format in section 5.
  • man 6 chess: This displays the manual page for the chess game in section 6.
  • man -k ssh: This searches for all manual pages containing the keyword ssh.
  • man -w grep: This displays the location of the manual page for the grep command.
  • man -S /usr/share/man:/usr/local/share/man ls: This specifies the directories to search for manual pages, and displays the manual page for the ls command.
  • man -a ls: This displays all manual pages for the ls command, in all available sections.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments

  1. […] Once installed, let’s first allow TCP traffic over your SSH port so that you don’t get locked out of…

  2. […] have the option to choose between Password and SSH key selection. Learn more about SSH keys here. It’s recommended…