In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Man is a tool in linux to provide online help for users. You can use the man command to view the help information of commands and files in linux.
Man command:
Syntax: man [OPTIONS] NAME
Common option:-a: search in all man help manuals
-k: list all matching pages
-f: equivalent to a whatis instruction that displays a short description of a given keyword
-P: use the paging program when specifying content
-M: specifies the path to the man manual search.
NUMBER: number of chapters. View the relevant content of the specified chapter directly.
The man manual is stored under / usr/share/man
There are some compressed files in these directories, and the process of using the man instruction is the process of finding the required files by man and decompressing the display.
The configuration file for the man command is generally stored in / etc/man.config (in centos7, the configuration file for the man command is stored in the / etc/man_db file)
As shown in the figure, the man search path is defined in this file, the man search path can be changed by modifying the configuration file, and the search location of the new manual file can be indicated by adding MANRATH / PATH/TO/SOMEWHERE to the file. You can also use the
Man-M / PATH/TO/SOMEWHERE COMMAND to the specified location to search the man page of the COMMAND command and display
The man manual is divided into different chapters.
1. User command
two。 System call
3.C library call
4. Equipment documents and special documents
5. Configuration file format
6. Games
7. Miscellaneous
8. Commands for managing classes
9.linux kernel API
Use the man [chapters] command to view the specified command sections. For example, there are two passwd commands in the man manual and in different chapters, we can use the man-f passwd or whatis passwd command to display passwd short description information.
(note: to use this command, you must create a whatis database. To create this database, you need to execute the command "makewhatis" as root. If there are changes in centos7, you need to execute "makedb" to create the database.)
As you can see, passwd exists in Chapter 1 and Chapter 5, respectively, so you can use the man [Chapter] command to view the specified chapter.
You can also use man-a KEYWORD to view all the manuals about KEYWORD. The-an option means to view all of them. The first step is to enter the previous chapter. Press the Q key to exit the current chapter and you will see the next chapter until the end.
For example, we can check how to use the man command. The command section is in the first chapter, so we can view it directly using man man instead of marking the chapters.
~] # man man
In the example, you can see that man page starts with NAME and ends with SEE ALSO.
Basically, in man page, it can be roughly divided into several parts, namely:
NAME (command name)-- the name and brief introduction of the command.
The basic format of the SYNOPSIS-- command.
DESCRIPTION-- describes an overview of command functionality.
OPTIONS (options)-the most basic part of the man command: the various options for the command, as well as a brief introduction to each option.
FILES (file)-other files used by the command.
AUTHOR (author)-the author who wrote the command, as well as contact information.
BUGS-known errors and how to report new errors.
EXAMPLE (example)-- some cases that can be referenced
COPYRIGHT (copyright notice)-its meaning is obvious, that is, copyright information.
SEE ALSO (see)-- other related commands.
There is a basic format of commands in SYNOPSIS
[]: indicates optional content
: indicates the required content
A | b: indicates one of the two
.: indicates that the same content can appear multiple times
The operation method of the man command is implemented using the less command, and there are some ways to use it in man page
Spaces, ctrl+V,ctrl+f/F: flip the screen to the end of the file
B, ctrl+B: flip the screen to the head of the file
D _ ctrlview D flips half the screen to the end of the file.
Uther ctrlteacher U: turn half the screen to the head of the file.
RETURN, ctrl+N, e, ctrl+E,ctrl+ j, ctrl+J: flip a line to the end of the file
Y, cctrl+Y, ctrl+P, k, ctrl+K: turn one line to the head of the file
Q: exit
Num: jump to line num
1G: go back to the header of the file
G: turn to the end of the file
Man page supports the use of [pageup] and [pagedown] keys
At the same time, if you want to find certain keywords, you can type "/ KEYWORD" or "? keyword" at any time to actively find keywords.
/ keyword: a string specified by keywords, searching from the current location to the end of the file, insensitive to character case
N: next
N: previous
Keyword: searches the header of the file from the current location with the string specified by keyword as the keyword; it is not case-sensitive
N: in the same direction as the search command, next
N: in the opposite direction of the search command, last
As in the search above, enter / file
It will highlight the keyword, and you can use the n or N keys to jump.
Example: how to display the current login terminal number, hostname and current time when logging in by a character terminal
The user login display file is / etc/issue. You can man issue first.
Since it is relatively simple to write, we can also look at SEE ALSO and then go to man motd or agetty or mingetty
Information about ISSUE ESCAPES can be found in man mingetty.
The / etc/issue file can be modified according to the information
~] # vim / etc/issue
Display the results
So, be good at using man to help you learn Linux games better!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.