标签:
进程管理的三个主要任务:
[root@centos ~]# ps auxUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.0 0.1 2900 1436 ? Ss 01:28 0:02 /sbin/initroot 2 0.0 0.0 0 0 ? S 01:28 0:00 [kthreadd]root 3 0.0 0.0 0 0 ? S 01:28 0:00 [migration/0]root 4 0.0 0.0 0 0 ? S 01:28 0:00 [ksoftirqd/0]root 5 0.0 0.0 0 0 ? S 01:28 0:00 [migration/0]root 6 0.0 0.0 0 0 ? S 01:28 0:00 [watchdog/0]root 7 0.0 0.0 0 0 ? S 01:28 0:00 [events/0]root 8 0.0 0.0 0 0 ? S 01:28 0:00 [cgroup]root 9 0.0 0.0 0 0 ? S 01:28 0:00 [khelper]root 10 0.0 0.0 0 0 ? S 01:28 0:00 [netns]root 11 0.0 0.0 0 0 ? S 01:28 0:00 [async/mgr]root 12 0.0 0.0 0 0 ? S 01:28 0:00 [pm]root 13 0.0 0.0 0 0 ? S 01:28 0:00 [sync_supers]root 14 0.0 0.0 0 0 ? S 01:28 0:00 [bdi-default]root 15 0.0 0.0 0 0 ? S 01:28 0:00 [kintegrityd/0]root 16 0.0 0.0 0 0 ? S 01:28 0:00 [kblockd/0]root 17 0.0 0.0 0 0 ? S 01:28 0:00 [kacpid]root 18 0.0 0.0 0 0 ? S 01:28 0:00 [kacpi_notify]root 19 0.0 0.0 0 0 ? S 01:28 0:00 [kacpi_hotplug]root 20 0.0 0.0 0 0 ? S 01:28 0:00 [ata_aux]654321root 21 0.0 0.0 0 0 ? S 01:28 0:00 [ata_sff/0]root 22 0.0 0.0 0 0 ? S 01:28 0:00 [ksuspend_usbd]root 23 0.0 0.0 0 0 ? S 01:28 0:00 [khubd]root 24 0.0 0.0 0 0 ? S 01:28 0:00 [kseriod]root 25 0.0 0.0 0 0 ? S 01:28 0:00 [md/0]root 26 0.0 0.0 0 0 ? S 01:28 0:00 [md_misc/0]root 27 0.0 0.0 0 0 ? S 01:28 0:00 [linkwatch]root 28 0.0 0.0 0 0 ? S 01:28 0:00 [khungtaskd]root 29 0.0 0.0 0 0 ? S 01:28 0:00 [kswapd0]root 30 0.0 0.0 0 0 ? SN 01:28 0:00 [ksmd]root 31 0.0 0.0 0 0 ? S 01:28 0:00 [aio/0]root 32 0.0 0.0 0 0 ? S 01:28 0:00 [crypto/0]root 37 0.0 0.0 0 0 ? S 01:28 0:00 [kthrotld/0]root 38 0.0 0.0 0 0 ? S 01:28 0:00 [pciehpd]root 40 0.0 0.0 0 0 ? S 01:28 0:00 [kpsmoused]root 41 0.0 0.0 0 0 ? S 01:28 0:00 [usbhid_resumer]root 71 0.0 0.0 0 0 ? S 01:28 0:00 [kstriped]root 146 0.0 0.0 0 0 ? S 01:28 0:00 [scsi_eh_0]root 147 0.0 0.0 0 0 ? S 01:28 0:00 [scsi_eh_1]root 155 0.0 0.0 0 0 ? S 01:28 0:00 [mpt_poll_0]root 156 0.0 0.0 0 0 ? S 01:28 0:00 [mpt/0]root 157 0.0 0.0 0 0 ? S 01:28 0:00 [scsi_eh_2]root 281 0.0 0.0 0 0 ? S 01:28 0:00 [jbd2/sda5-8]root 282 0.0 0.0 0 0 ? S 01:28 0:00 [ext4-dio-unwrit]root 292 0.0 0.0 0 0 ? S 01:28 0:00 [flush-8:0]root 374 0.0 0.1 2768 1060 ? S<s 01:28 0:00 /sbin/udevd -droot 632 0.0 0.0 0 0 ? S 01:28 0:00 [vmmemctl]root 705 0.0 0.0 0 0 ? S 01:28 0:00 [jbd2/sda1-8]root 706 0.0 0.0 0 0 ? S 01:28 0:00 [ext4-dio-unwrit]root 707 0.0 0.0 0 0 ? S 01:28 0:00 [jbd2/sda2-8]root 708 0.0 0.0 0 0 ? S 01:28 0:00 [ext4-dio-unwrit]root 753 0.0 0.0 0 0 ? S 01:28 0:00 [kauditd]root 963 0.0 0.0 12932 800 ? S<sl 01:28 0:00 auditdroot 989 0.0 0.1 36164 1556 ? Sl 01:29 0:00 /sbin/rsyslogd -i /var/run/syslogd.rpc 1031 0.0 0.0 2576 800 ? Ss 01:29 0:00 rpcbindrpcuser 1049 0.0 0.1 2840 1268 ? Ss 01:29 0:00 rpc.statddbus 1104 0.0 0.1 13372 1148 ? Ssl 01:29 0:00 dbus-daemon --systemroot 1121 0.0 0.2 13328 2756 ? Ss 01:29 0:00 cupsd -C /etc/cups/cupsd.confroot 1146 0.0 0.0 2020 596 ? Ss 01:29 0:00 /usr/sbin/acpid68 1155 0.0 0.4 16932 4172 ? Ssl 01:29 0:00 haldroot 1156 0.0 0.1 3980 1140 ? S 01:29 0:00 hald-runnerroot 1185 0.0 0.1 4052 1052 ? S 01:29 0:00 hald-addon-input: Listening on /dev68 1199 0.0 0.0 3644 1008 ? S 01:29 0:00 hald-addon-acpi: listening on acpidroot 1219 0.0 0.1 29008 1584 ? Ssl 01:29 0:00 automount --pid-file /var/run/autofroot 1239 0.0 0.1 8944 1044 ? Ss 01:29 0:00 /usr/sbin/sshdroot 1315 0.0 0.2 12964 2604 ? Ss 01:29 0:00 /usr/libexec/postfix/masterpostfix 1323 0.0 0.2 13040 2564 ? S 01:29 0:00 pickup -l -t fifo -upostfix 1324 0.0 0.2 13108 2608 ? S 01:29 0:00 qmgr -l -t fifo -uroot 1339 0.0 0.0 6460 868 ? Ss 01:29 0:00 /usr/sbin/abrtdroot 1347 0.0 0.1 7144 1280 ? Ss 01:29 0:01 crondroot 1358 0.0 0.0 2988 468 ? Ss 01:29 0:00 /usr/sbin/atdroot 1370 0.0 0.0 8784 568 ? Ss 01:29 0:00 /usr/sbin/certmonger -S -p /var/runroot 1383 0.0 0.2 5624 2636 ? Ss 01:29 0:00 login -- rootroot 1385 0.0 0.0 2008 476 tty2 Ss+ 01:29 0:00 /sbin/mingetty /dev/tty2root 1387 0.0 0.0 2008 476 tty3 Ss+ 01:29 0:00 /sbin/mingetty /dev/tty3root 1389 0.0 0.0 2008 500 tty4 Ss+ 01:29 0:00 /sbin/mingetty /dev/tty4root 1394 0.0 0.0 2008 476 tty5 Ss+ 01:29 0:00 /sbin/mingetty /dev/tty5root 1398 0.0 0.0 2008 472 tty6 Ss+ 01:29 0:00 /sbin/mingetty /dev/tty6root 1399 0.0 0.1 3424 1816 ? S< 01:29 0:00 /sbin/udevd -droot 1400 0.0 0.1 3424 1816 ? S< 01:29 0:00 /sbin/udevd -droot 1436 0.0 0.2 22616 2832 ? Sl 01:45 0:00 /usr/sbin/console-kit-daemon --no-droot 1503 0.0 0.1 8024 1684 tty1 Ss+ 01:45 0:00 -bashroot 1555 0.0 0.3 11888 3352 ? Ss 01:53 0:00 sshd: root@pts/0root 1560 0.0 0.1 6876 1692 pts/0 Ss+ 01:54 0:00 -bashroot 1623 0.0 0.3 11888 3348 ? Ss 02:04 0:00 sshd: root@pts/1root 1627 0.0 0.1 6876 1608 pts/1 Ss+ 02:04 0:00 -bashroot 1650 0.0 0.3 11888 3352 ? Ss 02:07 0:00 sshd: root@pts/2root 1656 0.0 0.1 6876 1676 pts/2 Ss+ 02:07 0:00 -bashroot 1715 0.0 0.3 11888 3352 ? Ss 02:19 0:00 sshd: root@pts/3root 1724 0.0 0.1 6876 1648 pts/3 Ss 02:20 0:00 -bashroot 1819 10.0 0.1 6552 1052 pts/3 R+ 02:48 0:00 ps aux[root@centos ~]# whoroot tty1 2014-09-16 01:45root pts/0 2014-09-16 01:54 (192.168.20.28)root pts/1 2014-09-16 02:04 (192.168.20.28)root pts/2 2014-09-16 02:07 (192.168.20.28)root pts/3 2014-09-16 02:20 (192.168.20.28)
[root@centos ~]# top
top - 03:42:56 up 2:14, 10 users, load average: 0.00, 0.00, 0.00Tasks: 110 total, 1 running, 109 sleeping, 0 stopped, 0 zombieCpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%stMem: 1030532k total, 199200k used, 831332k free, 31036k buffersSwap: 524280k total, 0k used, 524280k free, 68760k cachedPID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND2551 apache 20 0 36000 7024 1804 S 0.3 0.7 0:00.03 httpd2593 root 20 0 11888 3352 2604 S 0.3 0.3 0:00.24 sshd2616 root 20 0 2688 1092 868 R 0.3 0.1 0:00.24 top1 root 20 0 2900 1436 1216 S 0.0 0.1 0:02.12 init2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/04 root 20 0 0 0 0 S 0.0 0.0 0:00.05 ksoftirqd/05 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/06 root RT 0 0 0 0 S 0.0 0.0 0:00.16 watchdog/07 root 20 0 0 0 0 S 0.0 0.0 0:00.63 events/08 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm13 root 20 0 0 0 0 S 0.0 0.0 0:00.08 sync_supers14 root 20 0 0 0 0 S 0.0 0.0 0:00.08 bdi-default15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/016 root 20 0 0 0 0 S 0.0 0.0 0:00.32 kblockd/017 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kacpid
标签:
原文地址:http://www.cnblogs.com/lxw89/p/4683067.html