The ps command in Linux is the abbreviation of Process Status. The ps command is used to list the processes currently running in the system. The ps command lists snapshots of the current processes, that is, the processes at the time when the ps command is executed. If you want to display process information dynamically, you can use the top command. To monitor and control the process, you must first understand the current process status, that is, you need to view the current process, and the ps command is the most basic and also very powerful process viewing command. This command can be used to determine which processes are running and their running status, whether the processes have ended, whether the processes are dead, which processes are taking up too many resources, etc. In short, most of the information can be obtained by executing this command. ps provides a one-time view of the process. The results it provides are not dynamic and continuous. If you want to monitor the process time, you should use the top tool. The kill command is used to kill a process. 1. View all processes ps -eF -e: Select all processes. -F: Extra full format. PSR (Processor) shows the CPU where the process is located. 2. View all processes (including threads) ps -eLF -e: Select all processes. -L: Show threads, possibly with LWP and NLWP columns. -F: Extra full format. LWP (Low Weight Process), displays the thread number TID. To the Linux kernel, there is no difference between the management of threads and processes. To the user, a process may contain multiple threads. If PID and LWP are the same, the thread is the main thread of the process. 3. View in custom format ps -eLo pid,lwp,nlwp,sched,pri,psr,args -e: Select all processes. -L: Show threads, possibly with LWP and NLWP columns. -o: User-defined format. You can view the parameters you want to view, such as scheduling strategy, priority, etc. 4. pstree To view processes/threads in a tree format use the pstree command. pstree -p -p: Show PIDs. For the specific usage of ps and pstree, you may want to use the man command to view it. The above are all the relevant knowledge points compiled by the editor. Thank you for your learning and support for 123WORDPRESS.COM. |
<<: Detailed graphic tutorial on how to install the unzipped version of MySQL under Windows 10
>>: jQuery realizes the scrolling effect of table row data
Table of contents 1. What is Javascript? 2. What ...
Skip the Docker installation steps 1. Pull the po...
PHP related paths in Ubuntu environment PHP path ...
Vue3 project encapsulation side navigation text s...
Table of contents 1. Download 2. Installation 3. ...
Scenario: When page A opens page B, after operati...
Let’s learn together 1. Traditional methods Copy ...
Table of contents Methods that do not change the ...
This article takes the health reporting system of...
I re-read the source code of the Fabric project a...
Table of contents 1. What is the life cycle 2. Th...
Table of contents 1. The difference between funct...
View the nginx configuration file path Through ng...
How to configure custom path aliases in Vue In ou...
1. What is a proxy server? Proxy server, when the...