CentOS 无法使用pstree命令
2016-08-23 13:09
387 查看
先说一下什么是pstree, pstree以树结构显示进程(--display a tree of processes)
其优点在于您可以立即找出某进程的父进程:当您想要终止整个进程系列而且其中存在了许许多多的下属分支进程,您只需终止最上层的进程即可。您可能会需要使用 -p 选项显示每个进程的 PID,以及 -u 选项来显示启动该进程的用户名。一般来说,这一树结构比较长,您就需要这么执行 pstree:
但是centos7默认并没有安装pstree,所以会有pstree:command not found
安装方式使用命令即可。
其优点在于您可以立即找出某进程的父进程:当您想要终止整个进程系列而且其中存在了许许多多的下属分支进程,您只需终止最上层的进程即可。您可能会需要使用 -p 选项显示每个进程的 PID,以及 -u 选项来显示启动该进程的用户名。一般来说,这一树结构比较长,您就需要这么执行 pstree:
$ pstree -up | less 这将让您纵览整个进程树结构。
安装方式使用命令即可。
yum install psmisc
[root@CentOS7 ~]# yum install psmisc 已加载插件:fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.nwsuaf.edu.cn * updates: mirrors.163.com 正在解决依赖关系 --> 正在检查事务 ---> 软件包 psmisc.x86_64.0.22.20-9.el7 将被 安装 --> 解决依赖关系完成 依赖关系解决 ================================================================================ Package 架构 版本 源 大小 ================================================================================ 正在安装: psmisc x86_64 22.20-9.el7 base 140 k 事务概要 ================================================================================ 安装 1 软件包 总下载量:140 k 安装大小:479 k Is this ok [y/d/N]: y Downloading packages: psmisc-22.20-9.el7.x86_64.rpm | 140 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction 正在安装 : psmisc-22.20-9.el7.x86_64 1/1 验证中 : psmisc-22.20-9.el7.x86_64 1/1 已安装: psmisc.x86_64 0:22.20-9.el7 完毕!
相关文章推荐
- CentOS5.5无法使用ifconfig命令
- linux 无法使用pstree命令
- 解决:centos7镜像创建的容器里面安装服务后,无法使用命令启动服务
- centos自带python2.6无法使用pip命令
- CentOS 7 - 最小化安装后,解决无法使用yum命令问题
- CentOS中无法使用setup命令 -bash:setup: command not found
- CentOS 5中无法使用make,make install 命令 make: command not found
- 解决CentOS7下使用ifconfig命令无法查看inet地址
- 如何处理RedHat 7系列以及CentOS 7系列操作系统无法使用ifconfig命令
- CentOS下yum 命令无法使用,重新安装yum
- CentOS 7无法使用ifconfig命令修复
- Centos中无法使用make,make install,命令 make: command not found
- CentOS中无法使用setup命令 -bash:setup: command not found
- CentOS7.2 解决无法使用tab补全命令
- CentOS中无法使用setup命令 -bash:setup: command not found
- CentOS 6.5 中无法使用SELinux相关命令的解决方法
- CentOS最小安装无法使用ifconfig命令
- Centos中无法使用make,make install,命令 make: command not found
- CentOS中无法使用setup命令 -bash:setup: command not found
- linux 无法使用pstree命令