Linux ps command
Linux ps command displays the current process (process) state.
grammar
ps [options] [--help]
Parameters:
- ps The parameters are very much in this list only a few common parameters and provides an overview of the meaning of
- -A List all trips
- -w Display widening can display more information
- -au display more detailed information
- -aux display all trips include other users
- au (x) output format:
- USER PID% CPU% MEM VSZ RSS TTY STAT START TIME COMMAND
- USER: travel Owner
- PID: pid
- % CPU: the amount of CPU usage
- % MEM: memory usage occupied
- VSZ: virtual memory size occupied
- RSS: occupied memory size
- TTY: Secondary terminal unit number (minor device number of tty)
- STAT: The trip status:
- D: uninterruptible static (pass palpitate □□ Zhen b for I / O operation)
- R: being implemented
- S: stationary state
- T: suspend
- Z: is not present but temporarily can not be eliminated
- W: There is not enough memory can be allocated tab
- <: High Priority itinerary
- N: Low Priority itinerary
- L: There are memory allocation and locking tab in the memory body (or real-time systems suffer AI / O)
- START: Start Time travel
- TIME: execution time
- COMMAND: command executed
Examples
# ps -A 显示进程信息 PID TTY TIME CMD 1 ? 00:00:02 init 2 ? 00:00:00 kthreadd 3 ? 00:00:00 migration/0 4 ? 00:00:00 ksoftirqd/0 5 ? 00:00:00 watchdog/0 6 ? 00:00:00 events/0 7 ? 00:00:00 cpuset 8 ? 00:00:00 khelper 9 ? 00:00:00 netns 10 ? 00:00:00 async/mgr 11 ? 00:00:00 pm 12 ? 00:00:00 sync_supers 13 ? 00:00:00 bdi-default 14 ? 00:00:00 kintegrityd/0 15 ? 00:00:02 kblockd/0 16 ? 00:00:00 kacpid 17 ? 00:00:00 kacpi_notify 18 ? 00:00:00 kacpi_hotplug 19 ? 00:00:27 ata/0 ……省略部分结果 30749 pts/0 00:00:15 gedit 30886 ? 00:01:10 qtcreator.bin 30894 ? 00:00:00 qtcreator.bin 31160 ? 00:00:00 dhclient 31211 ? 00:00:00 aptd 31302 ? 00:00:00 sshd 31374 pts/2 00:00:00 bash 31396 pts/2 00:00:00 ps
Displays the user information
# ps -u root //显示root进程用户信息 PID TTY TIME CMD 1 ? 00:00:02 init 2 ? 00:00:00 kthreadd 3 ? 00:00:00 migration/0 4 ? 00:00:00 ksoftirqd/0 5 ? 00:00:00 watchdog/0 6 ? 00:00:00 events/0 7 ? 00:00:00 cpuset 8 ? 00:00:00 khelper 9 ? 00:00:00 netns 10 ? 00:00:00 async/mgr 11 ? 00:00:00 pm 12 ? 00:00:00 sync_supers 13 ? 00:00:00 bdi-default 14 ? 00:00:00 kintegrityd/0 15 ? 00:00:02 kblockd/0 16 ? 00:00:00 kacpid ……省略部分结果 30487 ? 00:00:06 gnome-terminal 30488 ? 00:00:00 gnome-pty-helpe 30489 pts/0 00:00:00 bash 30670 ? 00:00:00 debconf-communi 30749 pts/0 00:00:15 gedit 30886 ? 00:01:10 qtcreator.bin 30894 ? 00:00:00 qtcreator.bin 31160 ? 00:00:00 dhclient 31211 ? 00:00:00 aptd 31302 ? 00:00:00 sshd 31374 pts/2 00:00:00 bash 31397 pts/2 00:00:00 ps
Show all process information, together with the command line
# ps -ef //显示所有命令,连带命令行 UID PID PPID C STIME TTY TIME CMD root 1 0 0 10:22 ? 00:00:02 /sbin/init root 2 0 0 10:22 ? 00:00:00 [kthreadd] root 3 2 0 10:22 ? 00:00:00 [migration/0] root 4 2 0 10:22 ? 00:00:00 [ksoftirqd/0] root 5 2 0 10:22 ? 00:00:00 [watchdog/0] root 6 2 0 10:22 ? /usr/lib/NetworkManager ……省略部分结果 root 31302 2095 0 17:42 ? 00:00:00 sshd: root@pts/2 root 31374 31302 0 17:42 pts/2 00:00:00 -bash root 31400 1 0 17:46 ? 00:00:00 /usr/bin/python /usr/sbin/aptd root 31407 31374 0 17:48 pts/2 00:00:00 ps -ef