Summary of essential Linux commands for fire fighting (1) -- Query Problems

Source: Internet
Author: User

Some commands are essential for online troubleshooting. It is necessary to summarize some common commands (such commands and related parameters are quite a lot and only commonly used ones are summarized ), query problems can generally be divided into system parameters, performance parameters, processes, memory, network, storage, memory, and JVM:

System Parameters 
CAT/proc/cpuinfo CPU Parameters

CAT/proc/meminfo memory Parameters

CAT/proc/loadavg Load
Performance Parameters 
1) Top

M: sort by memory usage

P: sort by CPU usage

1: displays the usage of each CPU

K: Kill Process

O: More sorting rules

Enter: refresh data
2) ulimit
Ulimit-A: displays the user's system limit parameters

Ulimit-HN <num>: Change the maximum number of hard open files.

Ulimit-Sn <num>: Change the maximum number of soft open files.
3) vmstat
Vmstat 5-s m: refresh vmstat data in 5 seconds (unit: m)
Process 
1) PS
PS aux: displays details of all user processes

PS-EF: display details of all user processes in another style

If the display is incomplete, it can be widened through-W, such as PS aux-www.
Network 
1) netstat
Netstat-NA: displays all network connections

Netstat-nap: displays all network connections with process information

Netstat-NAT: displays all TCP network connections.

Netstat-ln: displays all network connections in the listener status
Storage 
1) DF-H: general situation of Hard Disk Storage
2) du -- Max-depth = 1-H <path>: specify the size of all folders in the path (recursive layer)
3) du-SH <path>: Specify the directory size.
Memory 
Free-m
It is worth noting that: idle memory = free + buffers + cached = total-used
JVM

1) jstat
Jstat-gccapacity <jpid>: The remaining status of each JVM region.
Jstat-gcutil <jpid>: JVM usage in each region
Jstat-gccause <jpid>: Causes of GC added to the jstat-gcutil Foundation
In addition, you can specify the update frequency, such as-H5 1 s: update every second, and add the header to display every five
2) JPs

Currently running Java Process
3) jmap

Jmap-dump: format = B, file = jmap. Log <jpid>: Generate heap dump file
Jmap-heap <jpid>: displays the overall situation of JVM heap.
Jmap-histo: Live <jpid>: displays memory usage of class instances.

4) jstack
Jstack-L <jpid>: displays thread congestion and deadlocks.

 

the commands and parameters are not described in detail. For more information, see the relevant documentation. This is so much for the time being and will be further supplemented.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.