1. Printing process [[email protected] program_test]# PS-E | Head
PID TTY Time CMD
1? 00:00:03 Init
2? 00:00:00 Kthreadd
5 y 00:00:00 migration/0
6} 00:00:00 ksoftirqd/0
3 y 00:00:00 migration/0
4} 00:00:00 watchdog/0
7? 00:00:00 events/0
8? 00:00:00 Cgroup
9? 00:00:00 Khelper 2, top CPU-intensive process list [[email protected] program_test]# Top
Top-23:45:17 up 1:12, 5 users, Load average:0.00, 0.00, 0.00
tasks:153 Total, 1 running, 143 sleeping, 9 stopped, 0 zombie
Cpu (s): 0.3%us, 0.3%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.3%hi, 0.0%si, 0.0%st
mem:1030528k Total, 377184k used, 653344k free, 32588k buffers
swap:2064376k Total, 0k used, 2064376k free, 170968k cached
PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND
4429 Root 0 2704 1140 880 R 0.7 0.1 0:00.12 Top
Root 0 0 0 0 S 0.3 0.0 0:01.63 ata_sff/0
2462 yy 0 73100 23m 18m S 0.3 2.3 0:12.11 VMTOOLSD
1 Root 0 2900 1436 1212 S 0.0 0.1 0:03.10 Init
3. List the processes that account for the most CPUs [[email protected] program_test]# Ps-eo comm,pcpu--sort-pcpu | Head
COMMAND%CPU
Xorg 0.5
VMTOOLSD 0.2
VMTOOLSD 0.2
init 0.0
Kthreadd 0.0
migration/0 0.0
ksoftirqd/0 0.0
migration/0 0.0
watchdog/0 0.0 4, print out bash progress corresponding Pid[[email protected] program_test]# ps-c bash-o pid=
2624
2650
2696
2732
2759
3842
Equivalent to the following command [[email protected] program_test]# Ps-aux | grep Bash |
awk ' BEGIN {fs= ' "} $11==" Bash "{print $} '
Warning:bad syntax, perhaps a bogus '-'? See/usr/share/doc/procps-3.2.8/faq
2624
2650
2759 5, enumerate the signals used: [[email protected] program_test]# kill-l
1) SIGHUP 2) SIGINT 3) Sigquit 4) Sigill 5) SIGTRAP
6) SIGABRT 7) Sigbus 8) SIGFPE 9) SIGKILL) SIGUSR1
One) (SIGSEGV) (SIGUSR2) sigpipe) sigalrm) SIGTERM
Sigstkflt) (SIGCHLD) Sigcont SIGSTOP) SIGTSTP
(Sigttin) Sigttou () Sigurg) sigxcpu) Sigxfsz
(SIGVTALRM) sigprof) sigwinch SIGIO) SIGPWR
Sigsys) (sigrtmin) sigrtmin+1) sigrtmin+2 Notoginseng) sigrtmin+3
sigrtmin+4) sigrtmin+5 (sigrtmin+6) sigrtmin+7) sigrtmin+8
sigrtmin+9) (sigrtmin+10) sigrtmin+11 () sigrtmin+12) sigrtmin+13
(sigrtmin+14) sigrtmin+15 () SIGRTMAX-14) SIGRTMAX-13) SIGRTMAX-12
SIGRTMAX-11) SIGRTMAX-10 SIGRTMAX-9) SIGRTMAX-8 () SIGRTMAX-7
(SIGRTMAX-6) (SIGRTMAX-5) SIGRTMAX-4) SIGRTMAX-3) SIGRTMAX-2
Lao Li share: "Linux shell Script Raiders" essentials (eight)