Specific use of Linux man command

Specific use of Linux man command

01. Command Overview

Linux provides a rich help manual. When you need to view the parameters of a command, you don’t have to search the Internet, just use man.

You can also use man man to view how to use man.

02. Command format

man [-adfhktwW] [section] [-M path] [-P pager] [-S list] [-m system] [-p string] title…

03. Common options

Usage: man [OPTION...] [section] man page...
 -a, --all find all matching manual pages -d, --debug output debugging information -D, --default reset all options to default values ​​--warnings[=WARNING] turn on groff warnings -f, --whatis equivalent to whatis
 -h displays the syntax and parameter description of man and exits the program after execution.
 -k, --apropos is equivalent to apropos and will search the whatis database for fuzzy search keywords -S, -s, --sections=list uses a colon-separated list of sections -t, --troff uses groff to typeset manual pages -w, --where, --path, --location
               Output the physical location of the manual page -W, --where-cat, --location-cat
               Output the physical location of the cat file -c, --catman Used by catman to correct outdated cat
               Page reformatting -C, --config-file=file Use this user configuration file -K, --global-apropos search for text in all pages
 -M, --manpath=path Set the search path for manual pages to 'path'
 -?, --help give this help list
   --usage give a short usage message
 -V, --version print program version
 -R, --recode=encode output source page encoded in ENCODING
 Find the man page:
 -L, --locale=LOCAL Define the locale to use for this manual page search -m, --systems=SYSTEM use manual pages from other systems
 -e, --extension=extended Limit the search to manual pages with extension type "extended" -i, --ignore-case Do not distinguish between uppercase and lowercase letters when searching manual pages (default)
 -I, --match-case Match uppercase and lowercase letters when searching man pages.

   --regex show all pages matching regex
   --wildcard show all pages matching wildcard

   --names-only makes --regex and --wildcard match page names only,
               not descriptions 

04. Related description

4.1 Structure and meaning of man command help information

Structure Name Representative significance
NAME Command name and brief description of its function
SYNOPSIS How to use parameters
DESCRIPTION A detailed description of the command function, including the meaning of each option
EXAMPLES Usage examples (with simple instructions)
OVERVIEW Overview
DEFAULTS Default functionality
OPTIONS Specific available options (with descriptions)
ENVIRONMENT Environment variables
FILES Used files
SEE ALSO Related information
HISTORY Maintenance History and Contact Details

4.2 Overview of man chapters

-S section-list The list is a colon-delimited list of manual pages to search. This option overrides the MANSECT environment variable.
  Some instructions or procedures may have more than one topic, which are located in different sections. So, to view later sections, you can specify here the order in which man should search for sections. The specific segment divisions are as follows:
  Section 1: User commands Section 2: System calls Section 3: Library calls Section 4: Devices Section 5: File formats Section 6: Games Section 7: Miscellaneous Section 8: System commands Section 9: Kernel internal commands Section n: Tcl or Tk commands 

4.3 Common keys and their uses in man command

button usefulness
Spacebar Scroll down one page
Page down Scroll down one page
Page up Go up one page
home Go directly to the home page
end Go directly to the last page
/ Search for a keyword from top to bottom, such as "/linux"
? Search for a keyword from bottom to top, such as "?linux"
n Locate the next searched keyword
N Locate the last searched keyword
q Exit Help Document

05. Reference examples

5.1 User Commands

The whatis command can be used to query what function a command performs and print the query results to the terminal.

[deng@localhost ~]$ whatis cd 
cd (1) - GNU Bourne-Again SHell (GNU Command Interpreter "Bourne II")
cd (3tcl) - change the working directorycd (1p) - change the working directory
[deng@localhost ~]$

From the output above, we can see that the cd command is a built-in command of bash. Its function is to change the current directory. You can view its help in chapters 1 and 1p.

View the bash command, and then search through /cd [deng@localhost ~]$ man 1 cd 
Use the following command to directly view the help information of cd.
[deng@localhost ~]$ man 1p cd

5.2 System calls

[deng@localhost ~]$ man 2 read

5.3 Library calls

[deng@localhost ~]$ man 3 sleep

5.4 Special files (device files)

[deng@localhost ~]$ man 4 tty

5.5 File format (Syntax of configuration files)

[deng@localhost ~]$ man 5 passwd

5.6 Management Commands

[deng@localhost ~]$ man 8 fdisk

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of rm and mv in the Linux command man page
  • Linux automatically runs rman incremental backup script

<<:  Example of how to set automatic creation time and modification time in mysql

>>:  mysql backup script and keep it for 7 days

Recommend

Write a formal blog using XHTML CSS

The full name of Blog should be Web log, which me...

Introduction to the usage of common XHTML tags

There are many tags in XHTML, but only a few are ...

HTML page native VIDEO tag hides the download button function

When writing a web project, I encountered an intr...

How to delete the container created in Docker

How to delete the container created in Docker 1. ...

Programs to query port usage and clear port usage in Windows operating system

In Windows operating system, the program to query...

Example of building a Jenkins service with Docker

Pull the image root@EricZhou-MateBookProX: docker...

The problem of form elements and prompt text not being aligned

Recent projects involve the creation of a lot of ...

Detailed examples of how to use the box-shadow property in CSS3

There are many attributes in CSS. Some attributes...

MYSQL uses Union to merge the data of two tables and display them

Using the UNION Operator union : Used to connect ...

Differences and comparisons of storage engines in MySQL

MyISAM storage engine MyISAM is based on the ISAM...

Detailed explanation of using MySQL where

Table of contents 1. Introduction 2. Main text 2....

Implementation of vue+drf+third-party sliding verification code access

Table of contents 1. Background 2. Verification p...

MySQL 5.7.18 Archive compressed version installation tutorial

This article shares the specific method of instal...