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

HTML head tag detailed introduction

There are many tags and elements in the HTML head ...

How to implement Hover drop-down menu with CSS

As usual, today I will talk about a very practica...

How to install multiple mysql5.7.19 (tar.gz) files under Linux

For the beginner's first installation of MySQ...

How to match the size of text in web design: small text, big experience

With the rise of mobile terminals such as iPad, p...

In-depth study of MySQL composite index

A composite index (also called a joint index) is ...

Getting Started with CSS3 Animation in 10 Minutes

Introduction Animation allows you to easily imple...

React antd tabs switching causes repeated refresh of subcomponents

describe: When the Tabs component switches back a...

Thoughts on copy_{to, from}_user() in the Linux kernel

Table of contents 1. What is copy_{to,from}_user(...

How to underline the a tag and change the color before and after clicking

Copy code The code is as follows: a:link { font-s...

How to skip errors in mysql master-slave replication

1. Traditional binlog master-slave replication, s...

Tutorial on binary compilation and installation of MySql centos7 under Linux

// It took me a whole afternoon to install this, ...