博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在top命令下kill和renice进程
阅读量:5870 次
发布时间:2019-06-19

本文共 5254 字,大约阅读时间需要 17 分钟。

For common process management tasks, top is so great because it gives an overview of the most active processes currently running (hence the name top). This enables you to easily find processes that might need attention. From top, you can also perform common process management tasks, such as adjusting the current process priority and killing processes.

[root@rhel7 ~]# toptop - 22:58:17 up 27 min,  1 user,  load average: 0.00, 0.01, 0.05Tasks:  88 total,   2 running,  86 sleeping,   0 stopped,   0 zombie%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 stKiB Mem :  1884188 total,  1651932 free,    85420 used,   146836 buff/cacheKiB Swap:  2097148 total,  2097148 free,        0 used.  1654104 avail Mem   PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                            1 root      20   0   44500   7104   2584 S  0.0  0.4   0:01.61 systemd                                            2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd                                           3 root      20   0       0      0      0 S  0.0  0.0   0:00.01 ksoftirqd/0                                        7 root      rt   0       0      0      0 S  0.0  0.0   0:00.00 migration/0                                        8 root      20   0       0      0      0 S  0.0  0.0   0:00.00 rcu_bh                                             9 root      20   0       0      0      0 S  0.0  0.0   0:00.00 rcuob/0                                           10 root      20   0       0      0      0 S  0.0  0.0   0:00.66 rcu_sched                                         11 root      20   0       0      0      0 R  0.0  0.0   0:00.30 rcuos/0                                           12 root      rt   0       0      0      0 S  0.0  0.0   0:00.02 watchdog/0                                        13 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 khelper                                           14 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kdevtmpfs                                         15 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 netns                                             16 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 perf                                              17 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 writeback                                         18 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kintegrityd                                       19 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 bioset                                            20 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kblockd                                           21 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 md                                                22 root      20   0       0      0      0 S  0.0  0.0   0:01.04 kworker/0:1                                       26 root      20   0       0      0      0 S  0.0  0.0   0:00.00 khungtaskd                                        27 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kswapd0                                           28 root      25   5       0      0      0 S  0.0  0.0   0:00.00 ksmd                                              29 root      39  19       0      0      0 S  0.0  0.0   0:00.01 khugepaged                                        30 root      20   0       0      0      0 S  0.0  0.0   0:00.00 fsnotify_mark                                     31 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 crypto                                            39 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kthrotld                                          41 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kmpath_rdacd                                      42 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kpsmoused                                         43 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 ipv6_addrconf                                     63 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 deferwq                                           93 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kauditd                                          253 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 ata_sff

 Now that you know how to use the  kill  and  nice  commands from the command line, using the same functionality from top is even easier. From top, type  k . top will then prompt for the PID of the process you want to send a signal to. By default, the most active process is selected. After you enter the PID, top asks which signal you want to send. By default, signal 15 for SIGTERM is used. However, if you want to insist a bit more, you can type  9  for SIGKILL. Now press  Enter  to terminate the process.  

To renice a running process from top, type  r . You are first prompted for the PID of the process you want to renice. After entering the PID, you are prompted for the nice value you want to use. Enter a positive value to increase process priority or a negative value to decrease process priority.  

 

转载地址:http://hbxnx.baihongyu.com/

你可能感兴趣的文章
ios 正则表达式
查看>>
javascript正则表达式对象方法 compile() exec() test()的比较
查看>>
SQL面试题
查看>>
Android开发之集成新浪微博SDK
查看>>
企业为什么需要上网行为管理
查看>>
字符串反转的5种方法
查看>>
MPLS *** option C
查看>>
嵌入式Linux C语言(二)——指针
查看>>
Java基础学习总结(8)——super关键字
查看>>
listview当选中某一个item时设置背景色其他的不变
查看>>
Eclipse Indigo 3.7 中文字体偏小解决方案: Consolas 微软雅黑混合字体!
查看>>
Hive 0.11 升级踩坑记——HiveServer2的imperson问题
查看>>
Maven学习总结(七)——eclipse中使用Maven创建Web项目
查看>>
Spring MVC常用注解说明
查看>>
CetOS(RHEL) 5.3下网卡绑定设置指南
查看>>
在Javascript中闭包(Closure)
查看>>
omap_hwmod: rtc: doesn't have mpu register target
查看>>
Linux执行ls,会引起哪些系统调用
查看>>
Linux 32位系统支持4G以上内存
查看>>
记录一些有用的代码技巧,不定期更新
查看>>