Basic knowledge
Linux command ps aux|grep xxx detailed explanation
To monitor and control the process, you must first understand the current process, that is, you need to view the current process, and the ps command (Process Status) is the most basic and also very powerful process viewing command.
Using this command, you can determine which processes are running and their running status, whether the process is terminated, whether the process has zombies, which processes occupy too many resources, etc. In short, most of the information can be obtained by executing this command.
ps provides us with a one-time view of the process, and the viewing results it provides are not dynamic and continuous; if you want to monitor the process time, you should use the top tool.
If you use the ps command directly, the status of all processes will be displayed, usually combined with the grep command to view the status of a process.
grep (global search regular expression(RE) and print out the line, comprehensive search for regular expressions and print out the line) is a powerful text search tool that uses regular expressions to search for text and print out the matching lines come out.
Example of use:
[root@node20 updateDB]# ps aux|grep ./update_stock
root 0.0 0.0 pts/ S+ : : grep ./update_stock
root 0.0 0.0 ? S Apr12 : ./update_stock
To monitor and control the process, you must first understand the current process, that is, you need to view the current process, and the ps command (Process Status) is the most basic and also very powerful process viewing command.
Using this command, you can determine which processes are running and their running status, whether the process is terminated, whether the process has zombies, which processes occupy too many resources, etc. In short, most of the information can be obtained by executing this command.
ps provides us with a one-time view of the process, and the viewing results it provides are not dynamic and continuous; if you want to monitor the process time, you should use the top tool.
If you use the ps command directly, the status of all processes will be displayed, usually combined with the grep command to view the status of a process.
grep (global search regular expression(RE) and print out the line, comprehensive search for regular expressions and print out the line) is a powerful text search tool that uses regular expressions to search for text and print out the matching lines come out.
Example of use:
[root@node20 updateDB]# ps aux|grep ./update_stock
root 0.0 0.0 pts/ S+ : : grep ./update_stock
root 0.0 0.0 ? S Apr12 : ./update_stock