关于 linux PS 命令

虽然经常用, 但是不是那么熟悉它竟然能提供那么多的信息. PS 是 Process Status 的缩写. top 命令的输出和 PS 很类似, 只不过是实时刷新.

ps --help all //显示所有的命令行参数
ps L //显示输出格式
ps H 16705 //显示特定进程的线程信息
ps --forest //显示进程直接的父子关系

ps -o ppid,pid,lwp,nlwp,%cpu,%mem,cputime,cmd,args k -%cpu H 16705 //输出一个进程的所有线程, 并且自定义格式, 按照 cpu 使用时间倒序排列.

关于格式中的nlwp: Number of Lightweight Processes. This basically amounts to the number of threads a program has running

一般结合 https://www.pslinux.online/index.php & ps --help all 就能找到想用的参数.

标签: none

添加新评论