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 Basic Overview Enable GTID onli...
The mobile version of the website should at least...
SSH stands for Secure Shell, which is a secure tr...
I believe that many users who make websites will ...
Generate Linux library The Linux version uses cen...
Cause of failure Today, when I was writing a caro...
It is a very common requirement to set the horizo...
HTML validate refers to HTML validation. It is the...
This article records the VMware Workstation 12 Pr...
Search Mirror docker search rocketmq View image v...
I'm building Nginx recently, but I can't ...
MySQL Performance Optimization MySQL is widely us...
Preface 1. The tools used in this article can be ...
This article shares the specific code of js to ac...
The parameter passed by ${param} will be treated ...