Use of man manual for basic Linux knowledge
In Linux, man is frequently used. Using it flexibly allows you to quickly learn how to use commands that you are not familiar. Next we will introduce man
Environment CentOS6.8
Man-format and display the on-line manual pages online user manual format and display
In general, it is the command user manual.
It consists of nine chapters
1. USER commands
2. System Call
3. C library call
4. Device Files and special files
5. Configuration File Format
6. Games
7. Miscellaneous
8. Manage commands and daemon
9. Linux kernel API (available after CentOS7)
The reason for dividing these nine chapters is that some commands belong to different classes. Check which chapter of man contains specific commands.
Whatis COMMAND
The following uses echo as an example to describe man's Manual content.
# Whatis echo
Echo (1)-display a line of text
Echo (1 p)-write arguments to standard output
Echo [builtins] (1)-bash built-in commands, see bash (1)
We can see from the above that echo belongs to man's first chapter.
The following explains the meaning of each item from the specific man 1 echo.
# Man 1 echo
Brief description of NAME command NAME and function
Echo-display a line of text
SYNOPSIS usage instructions, including available options
Echo [SHORT-OPTION]... [STRING]...
Echo LONG-OPTION
<>: This symbol is mandatory.
[]: Optional content in this symbol
|: This symbol indicates one more
{}: Indicates a group.
...: The same content appears multiple times
Detailed DESCRIPTION of the DESCRIPTION command function, which may include the meaning of each item
Echo the STRING (s) to standard output.
-N do not output the trailing newline
-E enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
-- Help display this help and exit
-- Version
Output version information and exit
.
.
.
AUTHOR of AUTHOR
Written by Brian Fox and Chet Ramey.
REPORTING of program BUGS by using REPORTING BUGS
Report echo bugs to bug-coreutils@gnu.org
GNU coreutils home page: General help using GNU software: Report echo translation bugs to
COPYRIGHT
Copyright 2010 Free Software Foundation, Inc. License GPLv3 +: GNU
GPL version 3 or later This is free software: you are free to change and redistribute it.
There is no warranty, to the extent permitted by law.
See also for more information
The full documentation for echo is maintained as a Texinfo manual. If
The info and echo programs are properly installed at your site,
Command
Info coreutils 'echo invocation'
Shoshould give you access to the complete manual.
Some Commands include OPTIONS (meaning of each option), FILES (configuration FILES related to this command), and ARGUMENTS (Objects used by the command), which generally include the preceding items.
Shortcut Keys in the man command for viewing text information
Enter return key: turning one row backward k: turning one row forward
Ctrl + d: half screen to the end of the file ctrl + u: half screen to the first part of the file
G: Jump to the last line # G: Jump to the specified line, # indicates the row number
Man search, used to quickly locate required information in man Manual
/Keyword: uses the string specified by keyword as the keyword to search for the end of the file from the location of the current interface. It is case insensitive.
N: Next N: Previous
? Keyword: uses the string specified by keyword as the keyword to search for the file header from the location of the current interface. It is case insensitive.
N: in the same direction as the shrink command, the next N: in the reverse direction of the SEARCH Command, the last n
Q is exited when the man manual is not read.
Man's practical application
The following describes the role of man through an actual problem.
Example: When a character terminal logs on, the current logon terminal number, host name, and current time are displayed.
To use man lookup to meet the above requirements, the prompt is: Modify the/etc/issue file. You can use man to view issue for help.
Let's first use cat to check the/etc/issue file.
# Cat/etc/issue
CentOS release 6.8 (Final)
Kernel \ r on an \ m
Then we
Man issue
Formatting page, please wait...
ISSUE (5) Linux Programmer's Manual ISSUE (5)
NAME
Issue-pre-login message and identification file
DESCRIPTION
The file/etc/issue is a text file which contains a message or system
Identification to be printed before the login prompt. It may contain in
Various @ char and \ char sequences, if supported by the getty-type pro-
Gram employed on the system.
FILES
/Etc/issue
SEE ALSO
Motd (5), agetty (8), mingetty (8)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project.
Description of the project, and information about reporting bugs, can
Be found at http://www.kernel.org/doc/man-pages.
Linux ISSUE (5)
You cannot find any valuable information. However, you can view the three files motd, agetty, and mingetty.
Man motd
MOTD (5) Linux Programmer's Manual MOTD (5)
NAME
Motd-message of the day
DESCRIPTION
The contents of/etc/motd are displayed by login (1) after a successful
Login but just before it executes the login shell.
The abbreviation "motd" stands for "message of the day", and this file
Has been traditionally used for exactly that (it requires much less
Disk space than mail to all users ).
FILES
/Etc/motd
SEE ALSO
Login (1), issue (5)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project.
Description of the project, and information about reporting bugs, can
Be found at http://www.kernel.org/doc/man-pages.
Linux 1992-12-29 MOTD (5)
There is no reference information in motd. continue to the next step.
Man agentty
AGETTY (8) AGETTY (8)
NAME
Agetty-alternative Linux getty
SYNOPSIS
Agetty [-8 ihLmnUw] [-f issue_file] [-l login_program] [-I init] [-t
Timeout] [-H login_host] port baud_rate,... [term]
Agetty [-8 ihLmnw] [-f issue_file] [-l login_program] [-I init] [-t
Timeout] [-H login_host] baud_rate,... port [term]
DESCRIPTION
Agetty opens a tty port, prompts for a login name and invokes
/Bin/login command. It is normally invoked by init (8 ).
Agetty has several non-standard features that are useful for hard-wired
And for dial-in lines:
O Adapts the tty settings to parity bits and to erase, kill, end-
Of-line and uppercase characters when it reads a login name.
The program can handle 7-bit characters with even, odd, none or
Space parity, and 8-bit characters with no parity. The following
Special characters are recognized: @ and Control-U (kill );#,
DEL and back space (erase); carriage return and line feed (end
Of line). See also -- erase-chars and -- kill-chars options.
O Optionally deduces the baud rate from the CONNECT messages pro-
Duced by Hayes (tm)-compatible modems.
...
..
.
Because this Manual contains a lot of content, we use/issue to quickly find relevant content about/etc/issue as a reference.
Connection and turn on auto-answer after 1 ring .)
/Sbin/agetty-w-I 'ate0q1 & D2 & C1S0 = 1 \ 015' 115200 ttyS1
ISSUE ESCAPES
The issue-file (/etc/issue or the file set with the-f option) may con-
Tain certain escape codes to display the system name, date and time
Etc. All escape codes consist of a backslash (\) immediately followed
By one of the letters explained below.
B Insert the baudrate of the current line.
D Insert the current date.
S Insert the system name, the name of the operating system.
L Insert the name of the current tty line.
M Insert the architecture identifier of the machine, eg. iworkflow
N Insert the nodename of the machine, also known as the hostname.
O Insert the NIS domainname of the machine.
O Insert the DNS domainname of the machine.
R Insert the release number of the OS, eg. 1.1.9.
T Insert the current time.
U Insert the number of current users logged in.
U Insert the string "1 user" or "<n> users" where <n> is the num-
Ber of current users logged in.
V Insert the version of the OS, eg. the build-date etc.
Example: On my system, the following/etc/issue file:
This is \ n. \ o (\ s \ m \ r) \ t
Displays
This is thingol. orcan. dk (Linux i386 1.1.9) 18:29:30
Here we can find \ l to solve the problem of displaying the current login terminal number, \ n to solve the host name problem, and \ t to solve the time display problem. Now that we have found the file, we will try to modify the/etc/issue file.
# Vi/etc/issue
CentOS release 6.8 (Final)
Kernel \ r on an \ m
\ L
\ N
Time is \ t
Wq is saved and exited.
Logout
Shown below
Solve the problem.
The use of man requires you to slowly explore in the usual use, so that the more you use, the more convenient. I hope you can read the help again.
This article permanently updates the link address: