Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 作品与服务 | Email

第 17 章 Process

目录

17.1. top - display Linux tasks
17.2. ps - report a snapshot of the current processes
17.2.1. ps axef
17.2.2. ps -eo pid,cmd
17.2.3. ps jax
17.2.4. zombie process
17.3. mpstat
17.4. pstree - display a tree of processes
17.5. pid
17.5.1. pgrep, pkill - look up or signal processes based on name and other attributes
17.5.2. pidof -- find the process ID of a running program.
17.6. jobs
17.6.1. &
17.6.2. Ctrl + Z
17.6.3. jobs
17.6.4. fg / bg
17.6.5. nohup - run a command immune to hangups, with output to a non-tty
17.7. ionice - get/set program io scheduling class and priority
17.8. /proc 目录与进程的关系
17.8.1. /proc/*/fd/ 进程所打开的文件

17.1. top - display Linux tasks

$ top
top - 22:30:02 up 14:24,  1 user,  load average: 0.17, 0.15, 0.10
Tasks: 240 total,   2 running, 238 sleeping,   0 stopped,   0 zombie
Cpu0  :  2.0%us,  4.1%sy,  0.0%ni, 92.9%id,  1.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  :  1.5%us,  3.7%sy,  0.1%ni, 94.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  :  2.2%us,  5.6%sy,  0.0%ni, 92.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  :  2.1%us,  6.3%sy,  0.0%ni, 91.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2048012k total,  1138504k used,   909508k free,   139292k buffers
Swap:  1951856k total,        0k used,  1951856k free,   603728k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4686 neo       20   0 19264 1440  980 R   11  0.1   0:00.10 top
 4698 neo       20   0  9440 1572 1044 S   11  0.1   0:00.27 sitemaps
    6 root      RT  -5     0    0    0 S    4  0.0   0:14.38 migration/1
    1 root      20   0 19320 1600 1132 S    0  0.1   0:01.50 init
    2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT  -5     0    0    0 S    0  0.0   0:10.41 migration/0

		
comments powered by Disqus