你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux下ps aux解释

[日期:2014-09-08] 来源:Linux社区  作者:he_wolf [字体:大 中 小]

 

ps aux的功能是打印出所有进程

 

ps是最基本也是最强大的进程查看命令

 

aux都是参数

 

a = show processes for all users 显示所有用户的进程
u = display the process's user/owner 显示用户
x = also show processes not attached to a terminal 显示无控制终端的进程

 

在下面即将介绍的axo中

 

o = 格式,用户定义的

 

1) Displaying top 10 CPU_consuming processes: 展示消耗CPU最多的10个进程
 # ps aux|head -1; ps aux|sort -rn +2|head -10
2) Displaying top 10 memory-consuming processes: 展示消耗内存最多的10个进程
# ps aux|head -1; ps aux|sort -rn +3|head

 

To view custom columns we use the below command
[root@server ~]# ps axo stat,euser,ruser,%mem,pid,%cpu,comm

 

Here
stat -> status of the process
euser -> effective user
ruser -> real user
%mem -> percentage of memory utilized by process
pid -> process ID
%cpu -> percentage of memory utilized by process
comm -> command

 


To view top 10 memory utilized process process
 [root@server ~]# ps axo ruser,%mem,comm,pid,euser | sort -nr | head -n 10
 RUSER    %MEM COMMAND          PID EUSER
root      0.4 sshd            3189 root
root      0.4 sshd            2486 root
root      0.2 master          1194 root
root      0.1 rsyslogd        2918 root
root      0.1 ps              3355 root
root      0.1 login            1217 root
root      0.1 bash            3191 root
root      0.1 bash            3080 root
root      0.1 bash            2488 root

 


To view top 10 memory utilized process process
[root@server ~]# ps axo ruser,%cpu,comm,pid,euser | sort -nr | head -n 10
RUSER    %CPU COMMAND          PID EUSER
root      0.2 events/0            7 root
root      0.0 watchdog/0          6 root
root      0.0 vsftpd          1118 root
root      0.0 vmmemctl          593 root
root      0.0 usbhid_resumer    41 root
root      0.0 udevd            420 root
root      0.0 udevd            1235 root
root      0.0 udevd            1234 root
root      0.0 sync_supers        13 root

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-09/106308.htm

linux
相关资讯       Linux ps aux 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款