The ps ax command displays a list of processes in the current system, including processes owned by other users. To display processes and their owners, run the ps aux command. The list is a static list. In other words, it is a snapshot of the process that is running when you enable this command. If you need Linux to view the list of running processes updated at a time, use the top command described below.
In Linux, the ps output of the process is very long. To prevent it from slipping quickly from the screen, you can output it to the less command:
Ps aux | less
You can use Linux to view the combination of the ps command and grep command to check whether a process is running. For example, to determine whether Emacs is running, run the following command:
Ps ax | grep emacs
In Linux, the "view process top" command displays the currently running processes and important information about them, including their memory and CPU usage. This list is both real-time and interactive. The following provides a top output example:
19:11:04 up, 9 users, load average: 0.00, 0.05, 0.12
89 processes: 88 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: cpuusernice systemirq softirq iowaitidle
Total6.6 % 0.0% 0.0% 0.0% 0.0% 0.0%
Cpu006.7 % 0.0% 0.1% 0.1% 0.0% 0.0%
Cpu010.0 % 0.0% 0.0% 0.0% 0.0% 0.0%
Mem: 1028556 k av, 241972 k used, 786584 k free, 0 k shrd, 37712 k buff
162316 k active, 18076 k inactive
Swap: 1020116 k av, 0 k used, 1020116 k free99340k cached
Pid user pri ni size rss share stat % CPU % MEMTIME CPU COMMAND
1899 root 150 17728 12 M 4172 S 6.5 1.2 X
6380 root 150 1144 1144884 R 0.3 0.10: 000 top
1 root 150488 488432 S 0.0 0.00: 051 init
2 root RT0 00 0 SW0.0 0.00: 000 migration/0
3 root RT0 00 0 SW0.0 0.00: 001 migration/1
4 root 150 00 0 SW0.0 0.00: 000 keventd
5 root 34 19 00 0 SWN0.0 0.00: 000 ksoftirqd/0
6 root 34 19 00 0 SWN0.0 0.00: 001 ksoftirqd/1
9 root 250 00 0 SW0.0 0.00: 000 bdflush
7 root 150 00 0 SW0.0 0.00: 001 kswapd
8 root 150 00 0 SW0.0 0.00: 001 kscand
10 root 150 00 0 SW0.0 0.00: 011 kupdated
11 root 250 00 0 SW0.0 0.00: 000 mdrecoveryd
To exit top, press the [q] key.
Interactive commands that can be used with Linux to view process top include:
Command description
[Space] refresh the display now
[H] display the help screen
[K] Kill a process. You will be prompted to enter the process ID and the signal to be sent to it.
[N] change the number of processes to be displayed. You will be prompted to enter the quantity.
[U] is sorted by user.
[M] sort by memory usage.
[P] sort by CPU usage.
- Detailed introduction to linux performance monitoring
- Development and Application of linux Network Monitoring System
- How to share Linux traffic monitoring
- System Monitoring: linux System Monitoring command details
- Linux memory monitoring process details