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

Implementing calculator functions with WeChat applet

This article is a simple calculator written using...

Vue achieves seamless carousel effect

This article shares the specific code of Vue to a...

Introduction to the steps of deploying redis in docker container

Table of contents 1 redis configuration file 2 Do...

innerHTML Application

Blank's blog: http://www.planabc.net/ The use...

How to implement variable expression selector in Vue

Table of contents Defining the HTML structure Inp...

How to modify the root password of mysql under Linux

Preface The service has been deployed on MySQL fo...

The complete process of Docker image creation

Table of contents Preface Creation steps Create a...

HTML markup language - form

Click here to return to the 123WORDPRESS.COM HTML ...

Implementation process of nginx high availability cluster

This article mainly introduces the implementation...

Centos7 implements sample code for restoring data based on MySQL logs

Introduction Binlog logs, that is, binary log fil...

12 Javascript table controls (DataGrid) are sorted out

When the DataSource property of a DataGrid control...

MySql grouping and randomly getting one piece of data from each group

Idea: Just sort randomly first and then group. 1....

Add ?v= version number after js or css to prevent browser caching

Copy code The code is as follows: <span style=...