|
发表于 2003-4-21 11:46:25
|
显示全部楼层
由于ps的输出是一PID号的顺序显示的,是不是可以通过把TIME域放在$1,如:
javalee//home/javalee>ps -A|awk '{print $3,$2,$1,$4}'|sort
00:00:00 ? 104 khubd
00:00:00 ? 12 kjournald
00:00:00 ? 2 keventd
00:00:00 ? 310 syslogd
00:00:00 ? 314 klogd
00:00:00 ? 352 xinetd
00:00:00 ? 361 crond
00:00:00 ? 394 xfs
00:00:00 ? 3 kapmd
00:00:00 ? 403 gdm-binary
00:00:00 ? 436 gdm-binary
00:00:00 ? 450 ksh
00:00:00 ? 480 gnome-session
00:00:00 ? 481 ssh-agent
00:00:00 ? 485 gconfd-2
00:00:00 ? 487 bonobo-activati
00:00:00 ? 491 gnome-settings-
00:00:00 ? 499 esd
00:00:00 ? 4 ksoftirqd_CPU0
00:00:00 ? 506 xscreensaver
00:00:00 ? 515 pam-panel-icon
00:00:00 ? 518 pam_timestamp_c
00:00:00 ? 544 consolehelper-g
00:00:00 ? 545 userhelper
00:00:00 ? 549 kppp
00:00:00 ? 551 kdeinit
00:00:00 ? 554 kdeinit
00:00:00 ? 557 kdeinit
00:00:00 ? 559 kdeinit
00:00:00 ? 567 kdeinit
00:00:00 ? 570 kdeinit
00:00:00 ? 573 kdeinit
00:00:00 ? 5 kswapd
00:00:00 ? 606 kdeinit
00:00:00 ? 608 kdesud
00:00:00 ? 6 bdflush
00:00:00 ? 7 kupdated
00:00:00 ? 8 mdrecoveryd
00:00:00 pts/0 529 ksh
00:00:00 pts/0 708 ps
00:00:00 pts/0 709 awk
00:00:00 pts/0 710 sort
00:00:00 tty1 402 mingetty
00:00:01 ? 482 chinput
00:00:01 ? 548 kppp
00:00:01 ? 575 kdeinit
00:00:02 ? 511 nautilus
00:00:03 ? 489 metacity
00:00:03 ? 509 gnome-panel
00:00:04 ? 1 init
00:00:09 ? 528 gnome-terminal
00:00:11 ? 517 rhn-applet-gui
00:00:31 ? 578 kdeinit
00:01:31 ? 604 kdeinit
00:03:23 ? 437 X |
|