Linux系统简单管理
1、Linux中的运行级别
Linux系统中有7个级别(run level),分别使用树字0-6来表示,一般在/etc/inittab文件中可以更改级别
run level 0:是作关机用的,所以不能设置initdefault中,也就是id:5:initdefaule的设置。否者一开机就会作关机的动作。
run level 1:都是Single user mode模式,只允许root账号登录,主要是作一些系统维护的工作。
run level 2:可以使所有的用户登录,但不会启用NFS working,也就是没有网络功能
run level 3:可以使所有用户登录,并拥有完整的功能。包含run level 2没有的功 能,但是开机后是用文本模式
run level 4 :使用者自己定义,但是默认情况下和run level 3完全相同,
run level 5:和run level 3几乎一样,唯一的不同是开机后是图形界面,
run level 6:重启。所以run level 6也不会设置在initdefault中,否者开机后立刻重启
使用指令runlevel显示当前的运行级别:
[root@Server ~]# runlevel
N 5
这里显示的是运行级别为5,此外还会显示上一次的运行级别,由于系统中不存在上一次的运行级别,那么就显示N
也可以使用指令init改便运行级别
init [0123456]
这样如果输入:
init 0,表示立刻关机
init 6,表示重新启动
2、服务的启动状况
Linux中的某些服务程序通常在系统的某些运行级别中运行,当系统进入相应的级别的时候,会自动的启动,使用chkconfig指令可以显示和设置系统中的所有服务在个运行级别的状态:
显示全部服务的启动状态
[root@Server ~]# chkconfig --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
NetworkManagerDispatcher 0:off 1:off 2:off 3:off 4:off 5:off 6:off
acpid 0:off 1:off 2:off 3:on 4:on 5:on 6:off
anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off
apmd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
avahi-daemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off
avahi-dnsconfd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
bluetooth 0:off 1:off 2:on 3:on 4:on 5:off 6:off
capi 0:off 1:off 2:off 3:off 4:off 5:off 6:off
conman 0:off 1:off 2:off 3:off 4:off 5:off 6:off
cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dhcdbd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
dund 0:off 1:off 2:off 3:off 4:off 5:off 6:off
firstboot 0:off 1:off 2:off 3:on 4:off 5:on 6:off
gpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off
haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off
hidd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
hplip 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ip6tables 0:off 1:off 2:on 3:on 4:on 5:off 6:off
ipmi 0:off 1:off 2:off 3:off 4:off 5:off 6:off
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
irda 0:off 1:off 2:off 3:off 4:off 5:off 6:off
irqbalance 0:off 1:off 2:on 3:on 4:on 5:on 6:off
isdn 0:off 1:off 2:on 3:on 4:on 5:off 6:off
kdump 0:off 1:off 2:off 3:off 4:off 5:off 6:off
kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off
lvm2-monitor 0:off 1:on 2:on 3:on 4:on 5:on 6:off
mcstrans 0:off 1:off 2:on 3:on 4:on 5:on 6:off
mdmonitor 0:off 1:off 2:on 3:on 4:on 5:on 6:off
mdmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
messagebus 0:off 1:off 2:off 3:on 4:on 5:on 6:off
microcode_ctl 0:off 1:off 2:on 3:on 4:on 5:on 6:off
multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
netplugd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
nscd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
openibd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
pand 0:off 1:off 2:off 3:off 4:off 5:off 6:off
pcscd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
portmap 0:off 1:off 2:off 3:on 4:on 5:on 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
readahead_early 0:off 1:off 2:on 3:on 4:on 5:on 6:off
readahead_later 0:off 1:off 2:off 3:off 4:off 5:on 6:off
restorecond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rhnsd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
rpcgssd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
rpcidmapd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
rpcsvcgssd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sendmail 0:off 1:off 2:on 3:on 4:on 5:off 6:off
setroubleshoot 0:off 1:off 2:off 3:on 4:on 5:on 6:off
smartd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vncserver 0:off 1:off 2:off 3:off 4:off 5:off 6:off
wdaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
winbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
wpa_supplicant 0:off 1:off 2:off 3:off 4:off 5:off 6:off
xfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ypbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
yum-updatesd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xinetd based services:
chargen-dgram: off
chargen-stream: off
cvs: off
daytime-dgram: off
daytime-stream: off
discard-dgram: off
discard-stream: off
echo-dgram: off
echo-stream: off
eklogin: off
ekrb5-telnet: off
gssftp: off
klogin: off
krb5-telnet: off
kshell: off
rsync: off
tcpmux-server: off
tftp: off
time-dgram: off
time-stream: off
显示指定服务的启动状态
[root@Server ~]# chkconfig --list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
设置独立服务的启动状态
使用指令chkconfig加上参数level可以指定服务在指定级别中的启动状态,语法为:
chkconfig --level 运行级别 服务名称 on|off
例如:
[root@Server ~]# chkconfig --list isdn
isdn 0:off 1:off 2:on 3:on 4:on 5:off 6:off
[root@Server ~]# chkconfig --level 345 isdn off
[root@Server ~]# chkconfig --list isdn
isdn 0:off 1:off 2:on 3:off 4:off 5:off 6:off
就将ISDN的345三个级别的服务关闭
使用指令chkconfig --list的时候,可以看到最下面的显示,
xinetd based services:
chargen-dgram: off
chargen-stream: off
cvs: off
daytime-dgram: off
daytime-stream: off
discard-dgram: off
discard-stream: off
echo-dgram: off
echo-stream: off
eklogin: off
ekrb5-telnet: off
gssftp: off
klogin: off
krb5-telnet: off
kshell: off
rsync: off
tcpmux-server: off
tftp: off
time-dgram: off
time-stream: off
这里的服务都是依赖于xinetd服务而启动的,所以不存在运行级别的问题,那么使用chkconfig指令的时候不需要指定运行级别。
如:
[root@Server ~]# chkconfig --list rsync
rsync off
[root@Server ~]# chkconfig rsync on
[root@Server ~]# chkconfig --list rsync
rsync on
要注意的是,这些服务必须是xinetd服务启动后才能启动,执行指令:
service xinetd start
3、进程
进程就是运行中的程序,当程序被启动后,Linux系统就会在内存中建立程序的进程,这样只要知道有那些进行在运行,就可以知道有那些程序已经运行起来。
使用ps指令查看进程
[root@Server ~]# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 2064 616 ? Ss Aug23 0:00 init [5]
root 2 0.0 0.0 0 0 ? S< Aug23 0:00 [migration/0]
root 3 0.0 0.0 0 0 ? SN Aug23 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S< Aug23 0:00 [watchdog/0]
root 5 0.0 0.0 0 0 ? S< Aug23 0:00 [events/0]
root 6 0.0 0.0 0 0 ? S< Aug23 0:00 [khelper]
root 7 0.0 0.0 0 0 ? S< Aug23 0:00 [kthread]
root 10 0.0 0.0 0 0 ? S< Aug23 0:00 [kblockd/0]
root 11 0.0 0.0 0 0 ? S< Aug23 0:00 [kacpid]
root 72 0.0 0.0 0 0 ? S< Aug23 0:00 [cqueue/0]
root 75 0.0 0.0 0 0 ? S< Aug23 0:00 [khubd]
root 77 0.0 0.0 0 0 ? S< Aug23 0:00 [kseriod]
root 137 0.0 0.0 0 0 ? S Aug23 0:00 [pdflush]
root 138 0.0 0.0 0 0 ? S Aug23 0:00 [pdflush]
root 139 0.0 0.0 0 0 ? S< Aug23 0:00 [kswapd0]
root 140 0.0 0.0 0 0 ? S< Aug23 0:00 [aio/0]
root 293 0.0 0.0 0 0 ? S< Aug23 0:00 [kpsmoused]
root 323 0.0 0.0 0 0 ? S< Aug23 0:00 [scsi_eh_0]
root 326 0.0 0.0 0 0 ? S< Aug23 0:00 [ata/0]
root 327 0.0 0.0 0 0 ? S< Aug23 0:00 [ata_aux]
root 330 0.0 0.0 0 0 ? S< Aug23 0:00 [kjournald]
root 357 0.0 0.0 0 0 ? S< Aug23 0:00 [kauditd]
root 391 0.0 0.1 2436 904 ? S<s Aug23 0:01 /sbin/udevd -d
root 850 0.0 0.0 0 0 ? S< Aug23 0:00 [kgameportd]
root 3824 0.0 0.0 0 0 ? S< Aug23 0:00 [kmpathd/0]
root 3851 0.0 0.0 0 0 ? S< Aug23 0:00 [kjournald]
root 3853 0.0 0.0 0 0 ? S< Aug23 0:00 [kjournald]
root 3855 0.0 0.0 0 0 ? S< Aug23 0:00 [kjournald]
root 3857 0.0 0.0 0 0 ? S< Aug23 0:00 [kjournald]
root 7399 0.0 0.0 0 0 ? S< Aug23 0:00 [ib_mcast]
root 7400 0.0 0.0 0 0 ? S< Aug23 0:00 [ib_inform]
root 7401 0.0 0.0 0 0 ? S< Aug23 0:00 [local_sa]
root 7407 0.0 0.0 0 0 ? S< Aug23 0:00 [ib_addr]
root 7413 0.0 0.0 0 0 ? S< Aug23 0:00 [iw_cm_wq]
root 7419 0.0 0.0 0 0 ? S< Aug23 0:00 [ib_cm/0]
root 7425 0.0 0.0 0 0 ? S< Aug23 0:00 [rdma_cm]
root 7454 0.0 0.0 0 0 ? S< Aug23 0:00 [ipoib]
root 7460 0.0 0.0 0 0 ? S< Aug23 0:00 [sdp]
root 7725 0.0 0.1 12132 656 ? S<sl Aug23 0:00 auditd
root 7727 0.0 0.1 12048 688 ? S<sl Aug23 0:00 /sbin/audispd
root 7750 0.0 0.1 1716 564 ? Ss Aug23 0:00 syslogd -m 0
root 7753 0.0 0.0 1672 400 ? Ss Aug23 0:00 klogd -x
rpc 7786 0.0 0.1 1804 552 ? Ss Aug23 0:00 portmap
root 7815 0.0 0.1 1816 716 ? Ss Aug23 0:00 rpc.statd
root 7851 0.0 0.1 5436 580 ? Ss Aug23 0:00 rpc.idmapd
dbus 7870 0.0 0.1 2880 876 ? Ss Aug23 0:00 dbus-daemon --system
root 7908 0.0 0.2 33212 1300 ? Ssl Aug23 0:01 pcscd
root 7939 0.0 0.0 1908 448 ? Ss Aug23 0:00 /usr/bin/hidd --server
root 7954 0.0 0.2 10832 1312 ? Ssl Aug23 0:00 automount
root 7973 0.0 0.1 1672 536 ? Ss Aug23 0:00 /usr/sbin/acpid
root 7984 0.0 0.1 5084 688 ? Ss Aug23 0:00 ./hpiod
root 7989 0.0 0.8 13256 4544 ? S Aug23 0:00 python ./hpssd.py
root 8004 0.0 0.2 6992 1052 ? Ss Aug23 0:00 /usr/sbin/sshd
root 8015 0.0 0.4 9736 2100 ? Ss Aug23 0:00 cupsd
root 8027 0.0 0.1 2716 844 ? Ss Aug23 0:00 xinetd -stayalive -pidfile /var/run
root 8038 0.0 0.0 1896 364 ? Ss Aug23 0:00 gpm -m /dev/input/mice -t exps2
root 8049 0.0 0.2 5268 1108 ? Ss Aug23 0:00 crond
xfs 8084 0.0 0.3 3972 1764 ? Ss Aug23 0:00 xfs -droppriv -daemon
root 8095 0.0 0.1 1664 528 ? SNs Aug23 0:00 anacron -s
root 8105 0.0 0.0 2240 424 ? Ss Aug23 0:00 /usr/sbin/atd
avahi 8141 0.0 0.2 2572 1344 ? Ss Aug23 0:00 avahi-daemon: running [Server.local
avahi 8142 0.0 0.0 2572 308 ? Ss Aug23 0:00 avahi-daemon: chroot helper
68 8153 0.1 0.7 5812 3904 ? Ss Aug23 0:02 hald
root 8154 0.0 0.2 3132 1064 ? S Aug23 0:00 hald-runner
68 8161 0.0 0.1 1996 800 ? S Aug23 0:00 hald-addon-acpi: listening on acpid
68 8167 0.0 0.1 1992 784 ? S Aug23 0:00 hald-addon-keyboard: listening on /
root 8176 0.0 0.1 1948 612 ? S Aug23 0:02 hald-addon-storage: polling /dev/hd
root 8258 0.0 0.0 1932 348 ? S Aug23 0:00 /usr/sbin/smartd -q never
root 8263 0.0 0.0 1656 424 tty1 Ss+ Aug23 0:00 /sbin/mingetty tty1
root 8265 0.0 0.0 1656 424 tty2 Ss+ Aug23 0:00 /sbin/mingetty tty2
root 8266 0.0 0.0 1656 428 tty3 Ss+ Aug23 0:00 /sbin/mingetty tty3
root 8267 0.0 0.0 1656 424 tty4 Ss+ Aug23 0:00 /sbin/mingetty tty4
root 8282 0.0 0.0 1656 424 tty5 Ss+ Aug23 0:00 /sbin/mingetty tty5
root 8283 0.0 0.0 1652 428 tty6 Ss+ Aug23 0:00 /sbin/mingetty tty6
root 8284 0.0 0.4 15452 2328 ? Ss Aug23 0:00 /usr/sbin/gdm-binary -nodaemon
root 8367 0.0 0.5 16200 2580 ? S Aug23 0:00 /usr/sbin/gdm-binary -nodaemon
root 8369 0.0 0.7 27388 3740 ? Sl Aug23 0:00 /usr/libexec/gdm-rh-security-token-
root 8372 2.2 1.6 16180 8644 tty7 Ss+ Aug23 1:02 /usr/bin/Xorg :0 -br -audit 0 -auth
root 8384 0.0 1.9 24444 9804 ? SN Aug23 0:00 /usr/bin/python -tt /usr/sbin/yum-u
root 8386 0.0 0.2 2552 1172 ? SN Aug23 0:00 /usr/libexec/gam_server
root 8403 0.0 1.5 23568 7992 ? Ss Aug23 0:00 /usr/bin/gnome-session
root 8433 0.0 0.0 0 0 ? Z Aug23 0:00 [Xsession] <defunct>
root 8436 0.0 0.1 6480 604 ? Ss Aug23 0:00 /usr/bin/ssh-agent /bin/sh -c exec
root 8465 0.0 0.1 2744 840 ? Ss Aug23 0:00 /bin/dbus-daemon --fork --print-pid
root 8466 0.0 0.0 2768 496 ? S Aug23 0:00 /usr/bin/dbus-launch --exit-with-se
root 8473 0.0 0.6 6816 3124 ? S Aug23 0:00 /usr/libexec/gconfd-2 5
root 8476 0.0 0.4 39504 2504 ? Ssl Aug23 0:00 /usr/libexec/bonobo-activation-serv
root 8481 0.4 0.6 12640 3464 ? S Aug23 0:10 /usr/libexec/at-spi-registryd --oaf
root 8484 0.0 0.1 2564 572 ? S Aug23 0:00 /usr/bin/gnome-keyring-daemon
root 8486 0.0 1.7 34444 8952 ? Sl Aug23 0:00 /usr/libexec/gnome-settings-daemon
root 8497 0.0 1.7 18148 8860 ? Ss Aug23 0:00 metacity --sm-client-id=default1
root 8506 0.0 2.4 48140 12632 ? Ss Aug23 0:01 gnome-panel --sm-client-id default2
root 8508 0.0 3.2 86180 16520 ? Ss Aug23 0:01 nautilus --no-default-window --sm-c
root 8512 0.0 2.1 47020 11012 ? S Aug23 0:00 /usr/libexec/wnck-applet --oaf-acti
root 8515 0.0 1.8 76172 9284 ? S Aug23 0:00 /usr/libexec/trashapplet --oaf-acti
root 8517 0.0 0.6 11092 3264 ? S Aug23 0:00 /usr/libexec/gnome-vfs-daemon
root 8519 0.0 1.7 45340 8904 ? Ss Aug23 0:00 eggcups --sm-client-id default4
root 8527 0.0 0.9 23288 4900 ? Ss Aug23 0:00 gnome-volume-manager --sm-client-id
root 8529 0.0 1.1 15936 6112 ? Ss Aug23 0:00 bt-applet --sm-disable
root 8550 0.0 4.0 38672 20836 ? Ss Aug23 0:01 /usr/bin/python -tt /usr/bin/puplet
root 8553 0.0 0.1 2468 828 ? S Aug23 0:00 /usr/libexec/mapping-daemon
root 8566 0.0 1.6 23464 8256 ? S Aug23 0:00 /usr/libexec/notification-area-appl
root 8568 0.0 2.1 29692 11168 ? S Aug23 0:00 /usr/libexec/clock-applet --oaf-act
root 8570 0.2 2.2 48156 11372 ? S Aug23 0:05 /usr/libexec/mixer_applet2 --oaf-ac
root 8575 0.0 1.9 45548 10192 ? Ss Aug23 0:00 nm-applet --sm-disable
root 8578 0.0 1.1 16972 6136 ? Ss Aug23 0:00 pam-panel-icon --sm-client-id defau
root 8580 0.0 1.3 45404 6768 ? Ss Aug23 0:02 gnome-power-manager
root 8584 0.0 0.1 1844 612 ? S Aug23 0:00 /sbin/pam_timestamp_check -d root
root 8585 0.0 0.5 18236 2632 ? Sl Aug23 0:00 ./escd --key_Inserted="/usr/bin/esc
root 8590 0.0 2.1 24932 11036 ? Ss Aug23 0:00 /usr/lib/scim-1.0/scim-launcher -d
root 8602 0.0 0.1 5976 540 ? Ss Aug23 0:00 /usr/lib/scim-1.0/scim-helper-manag
root 8603 0.0 1.0 27488 5288 ? Ssl Aug23 0:00 /usr/lib/scim-1.0/scim-panel-gtk --
root 8606 0.0 0.1 13440 820 ? Ss Aug23 0:00 /usr/lib/scim-1.0/scim-launcher -d
root 8629 0.0 0.1 12188 940 ? S Aug23 0:00 scim-bridge
root 8630 0.0 0.7 16456 3936 ? Ss Aug23 0:00 gnome-screensaver
root 8732 0.0 0.5 9840 2784 ? Ss Aug23 0:00 sshd: root@pts/1
root 8734 0.0 0.2 4660 1436 pts/1 Ss Aug23 0:00 -bash
root 8814 0.0 0.1 4244 932 pts/1 R+ 00:09 0:00 ps aux
USER :那个用户启动的此程序
PID :进程的ID号
TTY :这个进程在那个终端上运行
TIME:进程占用CPU的时间
COMMAND:京城的名称
其它的都是一些进程对系统资源的占用情况
使用top指令查看系统信息
[root@Server ~]#top
top - 00:11:45 up 51 min, 2 users, load average: 0.06, 0.08, 0.09
Tasks: 118 total, 1 running, 116 sleeping, 0 stopped, 1 zombie
Cpu(s): 2.1%us, 4.7%sy, 0.0%ni, 91.7%id, 1.1%wa, 0.2%hi, 0.1%si, 0.0%st
Mem: 515492k total, 463404k used, 52088k free, 31936k buffers
Swap: 1020088k total, 0k used, 1020088k free, 322460k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8570 root 15 0 48156 11m 8772 S 1.9 2.2 0:05.64 mixer_applet2
1 root 15 0 2064 616 532 S 0.0 0.1 0:00.54 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.05 events/0
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
7 root 12 -5 0 0 0 S 0.0 0.0 0:00.01 kthread
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.12 kblockd/0
11 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
72 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
75 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
77 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
137 root 25 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
138 root 15 0 0 0 0 S 0.0 0.0 0:00.15 pdflush
139 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kswapd0
140 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
293 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
323 root 19 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
326 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
327 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
330 root 13 -5 0 0 0 S 0.0 0.0 0:00.13 kjournald
357 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kauditd
391 root 18 -4 2436 904 388 S 0.0 0.2 0:01.88 udevd
850 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kgameportd
3824 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 kmpathd/0
3851 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kjournald
3853 root 15 -5 0 0 0 S 0.0 0.0 0:00.06 kjournald
3855 root 16 -5 0 0 0 S 0.0 0.0 0:00.61 kjournald
3857 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kjournald
7399 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 ib_mcast
7400 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 ib_inform
7401 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 local_sa
使用pstree查看进程树
[root@Server ~]# pstree
init─┬─acpid
├─anacron
├─at-spi-registry
├─atd
├─auditd─┬─audispd───{audispd}
│ └─{auditd}
├─automount───4*[{automount}]
├─avahi-daemon───avahi-daemon
├─bonobo-activati───{bonobo-activati}
├─bt-applet
├─clock-applet
├─crond
├─cupsd
├─2*[dbus-daemon]
├─dbus-launch
├─eggcups
├─escd───{escd}
├─events/0
├─gam_server
├─gconfd-2
├─gdm-binary───gdm-binary─┬─Xorg
│ └─gnome-session─┬─Xsession
│ └─ssh-agent
├─gdm-rh-security───{gdm-rh-security}
├─gnome-keyring-d
├─gnome-panel
├─gnome-power-man
├─gnome-screensav
├─gnome-settings-───{gnome-settings-}
├─gnome-vfs-daemo
├─gnome-volume-ma
├─gpm
├─hald───hald-runner─┬─hald-addon-acpi
│ ├─hald-addon-keyb
│ └─hald-addon-stor
├─hidd
├─hpiod
├─khelper
├─klogd
├─ksoftirqd/0
├─kthread─┬─aio/0
│ ├─ata/0
│ ├─ata_aux
│ ├─cqueue/0
│ ├─ib_addr
│ ├─ib_cm/0
│ ├─ib_inform
│ ├─ib_mcast
│ ├─ipoib
│ ├─iw_cm_wq
│ ├─kacpid
│ ├─kauditd
│ ├─kblockd/0
│ ├─kgameportd
│ ├─khubd
│ ├─5*[kjournald]
│ ├─kmpathd/0
│ ├─kpsmoused
│ ├─kseriod
│ ├─kswapd0
│ ├─local_sa
│ ├─2*[pdflush]
│ ├─rdma_cm
│ ├─scsi_eh_0
│ └─sdp
├─mapping-daemon
├─metacity
├─migration/0
├─6*[mingetty]
├─mixer_applet2
├─nautilus
├─nm-applet
├─notification-ar
├─pam-panel-icon───pam_timestamp_c
├─pcscd───3*[{pcscd}]
├─portmap
├─puplet
├─python
├─rpc.idmapd
├─rpc.statd
├─scim-bridge
├─scim-helper-man
├─2*[scim-launcher]
├─scim-panel-gtk───{scim-panel-gtk}
├─smartd
├─sshd───sshd───bash───pstree
├─syslogd
├─trashapplet
├─udevd
├─watchdog/0
├─wnck-applet
├─xfs
├─xinetd
└─yum-updatesd