Linux(十七)动态监控进程
Posted leeqico
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux(十七)动态监控进程相关的知识,希望对你有一定的参考价值。
17.1 介绍
top与ps命令很相似。它们都用来显示正在执行的进程。top与ps最大的不同之处,在于top在执行一段时间可以更新正在运行的进程
17.2 语法
top [选项]
常用选项
![技术分享图片](https://upload-images.jianshu.io/upload_images/2058461-370308d4b5a5f711.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
交互操作
![技术分享图片](https://upload-images.jianshu.io/upload_images/2058461-92785092a3303fc1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
17.3 实例
(1)监视特定用户
top::输入此命令,按回车键,查看执行的进程。
u:然后输入u,回车,再输入用户名,即可。
![技术分享图片](https://upload-images.jianshu.io/upload_images/2058461-fa9ef53d1b2324a7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术分享图片](https://upload-images.jianshu.io/upload_images/2058461-141e1db8f2ce0bfe.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
(2)终止指定的进程
输入“k”回车,再输入要结束的进程ID号。
![技术分享图片](https://upload-images.jianshu.io/upload_images/2058461-b8da76da14d72e2d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
(3)指定系统状态更新的时间
top -d 10
17.4 查看系统网络情况
(1)基本语法
netstat [选项]
(2)选项说明
-an 按一定顺序排列输出
-p 显示哪个进程在调用
(3)案例
查看系统所有的网络服务
![技术分享图片](https://upload-images.jianshu.io/upload_images/2058461-d6556344f57db3a6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看服务名为sshd的服务的信息。
![技术分享图片](https://upload-images.jianshu.io/upload_images/2058461-f43e24ae0677c5ed.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
以上是关于Linux(十七)动态监控进程的主要内容,如果未能解决你的问题,请参考以下文章
Linux基础21 进程介绍, 进程监控状态ps, 进程相关命令pstree,pgrep,pidof, 动态进程监控top, 进程中断概念, kill停止进程信号介绍pkill, killall
Linux crond任务调度 磁盘分区和挂载 网络环境 进程管理 服务(service)管理 动态监控进程 rpm和yum