Linux 命令大全
Linux ps命令用于显示当前进程 (process) 的状态。
ps [options] [--help]
参数:
# 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
显示指定用户信息
# 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
上一个教程:linux常用命令的英文单词缩写
下一个教程:linux下查看文件内容的命令