In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What this article shares with you is about the commands for viewing system information in Linux. 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.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
1. Check the system version: lsb_release-a
2. Check the kernel version: uname-a
3. Check the cpu model: cat / proc/cpuinfo
4. Check the hard disk space: df-h
5. View memory information: free-m
6. View network information: ifconfig
Commonly used commands to view linux environment information
Set the process number to pid and the port number to port.
1.CPU occupancy rate
Command: top-p pid,%CPU, in percentage.
two。 Physical memory usage
Command: top-p pid,RES, in KB.
3. Virtual memory usage
Command: top-p pid,VIRT, in KB.
4. Process queue length
Command: top,load average. The three values represent the average length of the queue for the last 1 minute, 5 minutes, and 15 minutes, respectively.
5. Open socket and its status
Command: netstat-an | grep port, the fourth column represents the source IP, the fifth column represents the destination IP, and the sixth column represents the status (such as LISTEN, ESTABLISHED, TIME_WAIT, etc.).
Alternative command: ss, several kernel modules need to be installed, and the performance is much better than netstat when there are many connections.
Install the kernel module command:
Insmod / lib/modules/2.6.18-164.el5/kernel/net/ipv4/inet_diag.ko
Insmod / lib/modules/2.6.18-164.el5/kernel/net/ipv4/tcp_diag.ko
Insmod / lib/modules/2.6.18-1.2.0.0-xen/kernel/net/ipv4/inet_diag.ko
Insmod / lib/modules/2.6.18-1.2.0.0-xen/kernel/net/ipv4/tcp_diag.ko
6. Utilization rate of Icano
Command: iostat-XJ% util, in percentage.
7. Disk read and write rate
Command: iostate-k kB_wrtn/s reads out how much KB data per second the disk reads, and how much data is written by the disk per second.
8. Recently used system calls and their time-consuming
Command: strace-f-tt-T-p pid, the first item represents the system call name, and the last item represents the time spent by the call, in seconds.
9. Number of open file descriptors
Command: ls / proc/pid/fd | wc-l.
10. Process address space
Command: pmap-d pid.
11. Environment variable
Command: cat / proc/pid/environ.
twelve。 Memory usage of each module of the process
Command: cat / proc/pid/smaps.
13. Process status information
Command: cat / proc/pid/status,State represents the process state (run, sleep, zombie, etc.), SleepAVG represents the proportion of the process sleep time, Tgid represents the thread group number, PPid represents the parent process number, FDSize represents the maximum number of file descriptors, VmSize generation
The size of the virtual address space of the table process. VLck represents the size of the physical memory locked by the process, which cannot be swapped to disk, VmRSS represents the size of physical memory being used by the process, VmData represents the size of the process data segment, and VmStk represents the process in user mode.
The size of the stack, VmExe represents the size of executable virtual memory owned by the process, code snippet, excluding the library used, VmLib represents the size of the library mapped to the process address space, the above units are KB,SigQ represents the number of signals to be processed, and SigBlk represents the blocked letter
SigIgn represents the ignored signal, and SigCgt represents the captured signal.
14. Number of threads in the process
Command: ls / proc/pid/task | wc-l.
15. The command line that starts the process
Command: cat / proc/pid/cmdline.
16. List which files are opened by the current system and which process opens them respectively
Command: sudo lsof-n
17. Make the program generate core dump files actively
Command: gdb-p pid-batch-ex "generate-core-file"
These are the commands for viewing system information in Linux. 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.