返回首页   进站必读

1.22 ps


1.22 ps

监视后台进程的工作情况

$ps
  PID TTY          TIME CMD
2575 pts/2 00:00:00 bash
4190 pts/2 00:00:00 ps

1.22.1 ps -a

显示终端上的所有进程,包括其他用户的进程。

$ps -a
  PID TTY          TIME CMD
1753 pts/0 00:00:00 tig
3640 pts/1 00:00:13 vi
4207 pts/2 00:00:00 ps

1.22.2 ps -u

查看进程所有者及其他一些详细信息。

$ps -u
USER       PID %CPU %MEM    VSZ   RSS TTY
STAT
START TIME COMMAND
ymqqqqdx 1563 0.0 0.1 6488 3664 pts/0 Ss 00:01 0:00 bash
ymqqqqdx 1753 0.0 0.0 4092 1492 pts/0 S+ 00:03 0:00 tig
ymqqqqdx 1801 0.0 0.1 6492 3668 pts/1 Ss 00:04 0:00 bash
ymqqqqdx 2575 0.0 0.1 6492 3656 pts/2 Ss 00:30 0:00 bash
ymqqqqdx 3640 1.0 0.3 13164 6340 pts/1 S+ 01:19 0:14 vi 1.11.md
ymqqqqdx 4226 0.0 0.0 2716 1072 pts/2 R+ 01:42 0:00 ps -u

1.22.3 ps -x

显示没有控制终端的进程

$ps -x
 1356 ?        Sl     0:00 /usr/bin/gnome-keyring-daemon --daemonize --login 
1374 ? Ssl 0:00 gnome-session
1405 ? Sl 0:30 /usr/bin/ibus-daemon --xim
1409 ? Ss 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-s
1412 ? S 0:00 /usr/bin/dbus-launch --exit-with-session gnome-sessio
1413 ? Ss 0:01 /bin/dbus-daemon --fork --print-pid 5 --print-address
1416 ? S 0:00 /usr/lib/libgconf2-4/gconfd-2
1417 ? S 0:00 /usr/lib/ibus/ibus-gconf
1419 ? S 0:11 python /usr/share/ibus/ui/gtk/main.py
1421 ? S 0:00 /usr/lib/ibus/ibus-x11 --kill-daemon
1423 ? S 0:21 python /usr/share/ibus-table/engine/main.py --ibus
1435 ? Ss 0:02 /usr/lib/gnome-settings-daemon/gnome-settings-daemon
1438 ? S 0:00 /usr/lib/gvfs/gvfsd
1445 ? Sl 0:02 gnome-power-manager
1446 ? SL 0:00 nm-applet --sm-disable
1447 ? S 0:00 /usr/lib/policykit-1-gnome/polkit-gnome-authenticatio
1449 ? S 0:00 bluetooth-applet
1451 ? S 1:16 /usr/bin/compiz