In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to understand the lsmod, lsof, lspci, lsscsi commands in the Linux system and how to practice. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Today, we mainly introduce lsmod, lsof, lspci, lsscsi commands and examples in Linux system.
1. Lsmod command
The Linux lsmod command is used to display the state information of modules that have been loaded into the kernel. All modules loaded into the system are listed after the lsmod command is executed. The core of the Linux operating system has the feature of modularization, so when compiling the core, you must put all the functions into the core. You can compile these functions into separate modules and load them separately when needed.
(1) grammar:
Lsmod
(2) examples:
Description:
Column 1: represents the name of the module.
Column 2: represents the size of the module.
Column 3: indicates the number of dependent modules.
Column 4: represents the contents of the dependent module.
Usually when using the lsmod command, commands such as lsmod | grep-I ext3 are used to query whether certain modules are loaded on the current system.
2. Lsof command
The Linux lsof command is used to view the file that your process starts, the process that opens the file, and the port that the process opens (TCP, UDP). Retrieve / recover deleted files. Is a very convenient system monitoring tool, because the lsof command requires access to core memory and various files, so it needs to be executed by root users.
In the linux environment, everything exists in the form of files, through which you can access not only regular data, but also network connections and hardware. Therefore, such as Transmission Control Protocol (TCP) and user Datagram Protocol (UDP) sockets, the system allocates a file descriptor to the application in the background, regardless of the nature of the file, the file descriptor provides a general interface for the interaction between the application and the underlying operating system. Because the descriptor list of the application's open files provides a lot of information about the application itself, being able to view this list through the lsof tool will be helpful for system monitoring and debugging.
(1) grammar:
Lsof (option)
Options:
-a: lists the processes that exist to open the file
-c: lists the files opened by the specified process
-g: list the details of the GID process
-d: lists the processes that occupy the file number
+ d: list the files opened in the directory
+ D: recursively list the files opened in the directory
-n: lists files that use NFS
-I: list the processes that meet the criteria. (4, 6, protocol,: Port, @ ip)
-p: lists the files opened by the specified process number
-u: list the details of the UID process
-h: displays help information
-v: displays version information.
(2) examples:
The significance of lsof's output of each column of information is as follows:
COMMAND: the name of the process
PID: process identifier
PPID: parent process identifier (the-R parameter needs to be specified)
USER: process owner
PGID: the group to which the process belongs
FD: a file descriptor that the application recognizes by the file descriptor
3. Lspci command
The Linux lspci command is used to display all PCI bus information for the current host, as well as information for all connected PCI devices.
(1) grammar:
Lspci (option)
Options:
-n: digitally display PCI manufacturer and device codes
-t: displays the hierarchical relationship of PCI devices in a tree structure, including all buses, bridges, devices, and connections between them
-b: bus-centric view
-d: displays only the information of a given manufacturer and equipment
-s: displays only the function block information on the specified bus, devices on slots, and devices
-I: specify the PCI numbered list file instead of using the default file
-m: displays PCI device information in a machine-readable manner.
(2) examples:
4. Lsscsi command
(1) Linux lsscsi command parameters:
-s displays the capacity size.
-c displays the default information with its full name.
-d displays the main and secondary equipment numbers.
-g displays the corresponding sg device name.
-H displays a list of host controllers,-Hl,-Hlv.
-l displays the relevant properties,-ll,-lll=-L.
-v displays the directory where the device properties are located.
-x displays the lun number in hexadecimal.
-p outputs the DIF,DIX protection type.
-P outputs valid protection mode information.
-I display udev-related properties
-w display WWN
(2) examples
The above is how to understand the lsmod, lsof, lspci, lsscsi commands in the Linux system and how to practice. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.