In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "Manual manual analysis in Linux". The explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn the Manual manual analysis in Linux.
Today, maybe many of us don't use the man command very often and are replaced by the friendlier and simpler tldr.
$tldr du | head du Disk usage: estimate and summarize file and directory space usage. -List the sizes of a directory and any subdirectories, in the given unit (B/KB/MB): du-{{b | k | m}} {{path/to/directory}}-List the sizes of a directory and any subdirectories, in human-readable form (i.e. Auto-selecting the appropriate unit for each size): du-h {{path/to/directory}} r-Show the size of a single directory, in human readable units:
However, the man command has always been my personal favorite. Whenever I am depressed, I will use the man command to do all kinds of queries. Slowly gain a sense of order, a sense of overall control, and the depressed mood is also slowly healed.
The man command allows us to communicate with the computer, and it seems to prompt us to integrate with the computer, man-machine integration.
Nine chapters of 1.man
Man is probably the only command that can state itself. Let's start with the most intuitive way to use it.
Man man
From the results, we see that the Manual manual is divided into nine chapters (sections). It seems a little too much, and we will classify it into four parts.
The first three items are commands (shell-commands, system-calls,libraries)
Then there is files (special-file,file-format)
And then Miscellaneous, and Game put it here, too.
Finally, System (Administation,Kernel)
two。 Storage address
Everything in the Linux system is a file, and the first thing we are interested in is where these manual manuals are stored. According to the previous article to help you master Linux: a thorough analysis of the directory tree structure of Linux can be easily inferred
The configuration file is in the / etc/ directory, specifically / etc/manpath.config
The variable file is in the / var/ directory, specifically / var/cache/man/index. (bt | db | dir | pag)
/ etc and / var are the two most important directories under the linux system.
The man file itself is stored in the / usr/share directory, / usr/share/man
How do I see where a particular command is stored? The-w option is required (corresponding to the long option-- where)
$man-w time / usr/share/man/man1/time.1.gz
Add the option-a (corresponding to-- all) to find out the location of time in all chapters.
$man-aw time / usr/share/man/man1/time.1.gz / usr/share/man/man2/time.2.gz / usr/share/man/man7/time.7.gz
As you can see from the results, the command time is available in man1 (shell commands), man2 (system calls), and man7 (Miscellaneous).
As a supplement, we can also use the-f option to view the sections to which the command belongs.
$man-f man man (7)-macros to format man pages man (1)-an interface to the on-line reference manuals $man-f time time (7)-overview of time and timers time (1)-run programs and summarize system resource usage time (2)-get time in seconds
The-f here is equivalent to-- whatis.
Whatis (1)-display one-line manual page descriptions
3. Specify query section
You can specify a chapter query by seeing the address of the command in the-w option.
Whatis (1)-display one-line manual page descriptions
Man 7 time
4. Regular query
The most interesting thing about the man command is regular query, which can be played all day when you are in a bad mood.
From regular queries, you can gain a sense of control over the overall situation, such as querying how many commands systemd has:
$man-k ^ systemd | nl | tail 158systemd.service (5)-Service unit configuration 159systemd.slice (5)-Slice unit configuration 160systemd.socket (5)-Socket unit configuration 161systemd.special (7)-Special systemd units 162systemd.swap (5)-Swap unit configuration 166systemd.syntax (7)-General syntax of systemd configuration files 164systemd.target (5)-Target unit configuration 165systemd.time (7)- Time and date specifications 166systemd.timer (5)-Timer unit configuration 167systemd.unit (5)-Unit configuration
China immediately learned the result 167 from the result.
Or query how many calendar-related commands are available:
$man-k calendar | nl 1 cal (1)-displays a calendar and the date of Easter 2 calendar (1)-reminder service 3 ncal (1)-displays a calendar and the date of Easter
Or query all the ls commands:
$man-k ^ ls | nl 1 ls (1)-list directory contents 2 lsar (1)-list archive file contents 3 lsattr (1)-list file attributes on a Linux second extended file system 4 lsb_release (1)-print distribution-specific information 5 lsblk (8)-list block devices 6 lscpu (1)-display information about The CPU architecture 7 lsearch (3)-linear search of an array 8 lseek (2)-reposition read/write file offset 9 lseek64 (3)-reposition 64-bit read/write file offset 10 lsetxattr (2)-set an extended attribute value 11 lshw (1)-list hardware 12 lsinitramfs (8)-list content of an initramfs image 13 lsipc (1) )-show information on IPC facilities currently employed in... 14 lslocks (8)-list local system locks 15 lslogins (1)-display information about known users in the system 16 lsmem (1)-list the ranges of available memory with their online status 17 lsmod (8)-Show the status of modules in the Linux Kernel 18 lsns (8)-list Namespaces 19 lsof (8)-list open files 20 lspci (8)-list all PCI devices 21 lspcmcia (8)-display extended PCMCIA debugging information 22 lspgpot (1)-extracts the ownertrust values from PGP keyrings and list... 23 lstat (2)-get file status 24 lstat64 (2)-get file status 25 lsusb (8)-list USB devices
5. Overall control
The system-calls command in section 2 was introduced at the beginning of the article. We can't help but wonder, which are system-calls?
$man-s 2-k. | | nl | tail 484vm86old (2)-enter virtual 8086 mode 485vmsplice (2)-splice user pages to/from a pipe 486vserver (2)-unimplemented system calls 487wait (2)-wait for process to change state 488wait3 (2)-wait for process to change state, BSD style 489wait4 (2)-wait for process to change state | BSD style 490 waitid (2)-wait for process to change state 491waitpid (2)-wait for process to change state 492write (2)-write to a file descriptor 493writev (2)-read or write data into multiple buffers
As can be seen from the above, there are 493 system-calls in the system. Let's analyze this line of command:
Man-s 2-k.
Short selections represent long options-section,-k is keyword, equivalent to the apropos command, and the final dot point is the expression of any character in the regular expression.
Therefore, only through the above simple command to get the entire document and even the entire computer, the overall sense of control of computer science. Let's take a quick look at these nine sections.
Section 1 Shell Commands system commands:
$man-s 1-k. | | nl | tail-n 5 2451 zless (1)-file perusal filter for crt viewing of compressed text 2452 zlib_decompress (1)-decompress mysqlpump ZLIB-compressed output 2453 zmore (1)-file perusal filter for crt viewing of compressed text 2454 znew (1)-recompress .Z files to .gz files 2455 zsoelim (1)-satisfy .so requests in roff input |
Section 2 Syetem Calls system call
$man-s 2-k. | | nl | tail-n 5489 wait4 (2)-wait for process to change state, BSD style 490 waitid (2)-wait for process to change state 491waitpid (2)-wait for process to change state 492write (2)-write to a file descriptor 493writev (2)-read or write data into multiple buffers |
Section 3 C LIbraries C Corpus
$man-s 3-k. | | nl | tail-n 5 1899 y1l (3)-Bessel functions of the second kind 1900 yn (3)-Bessel functions of the second kind 1901 ynf (3)-Bessel functions of the second kind 1902 ynl (3)-Bessel functions of the second kind 1903 zlib (3)-compression/decompression library |
Section 4 Special Files Special Files
$man-s 4-k. | | nl | tail-n 5 48 veth (4)-Virtual Ethernet Device 49 vmware (4)-VMware SVGA video driver 50 wacom (4)-Wacom input driver 51 wavelan (4)-AT&T GIS WaveLAN ISA device driver 52 zero (4)-data sink |
Secion 5 File Format and conventions file format and convention
$man-s 5-k. | | nl | tail-n 5 424 xorg.conf (5)-configuration files for Xorg X server 425 xorg.conf.d (5)-configuration files for Xorg X server 426 Xsession (5)-initialize Xsession 427 Xsession.options (5)-configuration options for Xsession (5) 428 Xwrapper.config (5)-Xorg X server binary wrapper |
Secion 6 Games Games
$man-s 6-k. | nl | tail-n 51 intro (6)-introduction to games 2 kmahjongg (6)-Mahjongg game for KDE 3 kmines (6)-KDE mine sweeper game 4 kpat (6)-A highly addictive card game. 5 ksudoku (6)-KDE Sudoku games
Section 7 Miscellaneous (including macro packages and conventions) Miscellaneous
$man-s 7-k. | | nl | tail-n 5470 XConsortium (7)-XConsortium information 471xkeyboard-config (7)-XKB data description files 472XOrgFoundation (7)-X.Org Foundation information 473Xsecurity (7)-X display access control 474XStandards (7)-X Window System Standards and Specifications |
Section 8 System administration commands (usually only for root) system Management Command
$man-s 8-k. | | nl | tail-n 5890 xtables-nft-multi (8)-iptables using nftables kernel api 891xtables-translate (8)-translation tool to migrate from iptables to nftables 892zdump (8)-timezone dumper 893zic (8)-timezone compiler 894zramctl (8)-set up and control zram devices |
Section 9 Kernel routines [Non standard] kernel function
➜~ man-s 9-k. Vmxnet (9)-vmware kernel module
Another way to control the overall situation is the intro command:
$man-f intro intro (8)-introduction to administration and privileged commands intro (7)-introduction to overview and miscellany section intro (3)-introduction to library functions intro (4)-introduction to special files intro (1)-introduction to user commands intro (5)-introduction to file formats and filesystems intro (6)-introduction to games intro (2)-introduction to system calls
We see that every section has an intro.
For example, let's look at the intro of section 2:
6. Games
Man commands have good healing effects, so take a look at the four games that come with Kubuntu.
$man-s 6-k. | nl 1 intro (6)-introduction to games 2 kmahjongg (6)-Mahjongg game for KDE 3 (6)-KDE mine sweeper game 4 kpat (6)-A highly addictive card game. 5 ksudoku (6)-KDE Sudoku games Thank you for your reading, the above is the content of "Manual Manual Analysis in Linux". After the study of this article, I believe you have a deeper understanding of the Manual manual analysis in Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.