1, Top command: View the current running process, and system resource consumption status.
A bit like Windows System Resource Manager, sometimes you can look at CPU consumption, sometimes to look at the memory footprint, and sometimes look at the hard disk IO usage, of course, it supports multiple CPU health view, you can see a few CPU resource consumption situation.
If you're using SSH to connect to the server, you can also open one of the ssh windows and run the top command to prevent the SSH connection from timing out (that's what I do, because I'm going to use SSH to connect to the client database, and if it's accidentally timed out, I had to spend more than a few minutes reconnecting ssh and opening the database, and I had to find the corresponding table, annoying.
2, kill command: Directly killed the process, but have to know the process ID number.
With the previous top command, you can clearly see the ID number of the process, then directly with the KILL-9 ID number directly off the process,-9 is mandatory, it has a lot of usage, I do not introduce, there is a need for everyone to search the Internet (Linux kill), if not too much trouble, do not want to learn too many related , just do what I said before. Of course, because the top command shows a limited number of processes, you may not be able to see all the relevant processes in the top list, if the kill half did not kill half, the next thing will be more trouble, so there will be the following PS command introduced the appearance, It's a practical command to accurately find the ID number of the process you want to turn off.
3, PS command: To view a program-related process information.
Customers call to complain, system crashes, with SSH connection to the client server, run top, found JBoss occupy cpu100%, and a few minutes also refused to release, from the customer's feedback, it should be a function of the customer in the system search some data, but did not limit the length of the search word, and so long no response, Then there is no response to the other place, the first reaction is to restart the JBoss ASAP, but the previously written JBoss shutdown shell code can not let JBoss stop, customers do not allow the system to stop for one more minute, So you have to quickly turn off the process associated with it (just like in Windows Explorer, let it end the process), and what are the related processes of jboss being inverted?
Then I quickly entered in the command window: PS Ax | grep jboss, haha, with jboss related several processes appear (usually have 3), then keep hand input corresponding kill-9 ID, turn off JBoss, wait a moment, and then open JBoss, in less than a minute, the system again normal operation.
So the upper part of the PS Ax | What does grep jboss mean, let me briefly introduce the following: PS is a list of the meaning of the system process; Ax is the parameter of the PS command, which means listing all the running processes; the "|" line is the meaning of the pipe, which is a very important concept in Linux, of course, Java, even DOS has this concept, The same; grep is the meaning of looking in the source text, JBoss is the parameter of grep, meaning to look up JBoss-related rows in the source text, and list the display, so what is the source text, at which point, the "|" line is the role, which shifts the results of the PS ax to grep as the source text.
I have limited capacity, more use can go to other places to refer to the relevant Linux commands.