Linux性能监控-ps
ps是显示瞬间进程的状态,并不动态连续;如果想对进程进行实时监控应该用top命令。
This version of ps accepts several kinds of options:PS接受以下3中类型的语法风格
1 UNIX options, which may be grouped and must be preceded by a dash.必须以-开头
2 BSD options, which may be grouped and must not be used with a dash.必须不能以-开头
3 GNU long options, which are preceded by two dashes.必须以两个-开头
ps aux = ps auxg = ps –e u
ps --help
simple selection
-A all processes 、-e all processes 显示所有进程信息
-a all w/ tty except session leaders显示所有TTY值存在的进程,除去bash和TTY终端等进程
a all w/ tty, including other users 显示所有TTY值存在的进程,包括其他用户的
查看当前bash pid
[root@node0 tmp]# echo $$
26873
-d all except session leaders 所有进程除去bash或TTY等
selection by list
根据某个属性的值对进程进行筛选
-C by command name 命令
-G by real group ID (supports names)
-U by real user ID (supports names)
-g by session OR by effective group name
-p by process ID 筛选进程pid
-q by process ID (unsorted & quick)
-s processes in the sessions given 按照session id筛选
-u by effective user ID (supports names)
U processes for specified users
-t by ttyt 、by tty 筛选终端
h 隐藏表格头
output format 格式化输出
-j,j job control 作业控制
显示PPID PID PGID SID等信息
-f full 长格式输出信息,显示更详细的信息
-l,l long 长格式输出信息,显示更详细的信息
long options
misc options,混合选项
L list format codes 列出所有可选属性