免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 13838 | 回复: 4
打印 上一主题 下一主题

ps -ef 和 ps -eLf 输出结果不一样? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-03-05 14:04 |只看该作者 |倒序浏览
RT,  -ef 和 -eLf输出结果数量不一样
xxx[oracle]_pcatdsh1> ps -eLf|wc -l
2863
xxx[oracle]_pcatdsh1> ps -ef|wc -l
2161
xxx[oracle]_pcatdsh1> ps -eLf|wc -l
2866

xxx[oracle]_pcatdsh1> ps -eLf|grep oracle|wc -l
2004
xxx[oracle]_pcatdsh1> ps -ef|grep oracle|wc -l
1673

我在计算主机上某个用户进程数时都是用ps -ef的, 最近看到同事有用ps -eLf的, 不知道有什么区别?  改以哪个为准?

论坛徽章:
0
2 [报告]
发表于 2012-03-05 14:13 |只看该作者
man ps

论坛徽章:
0
3 [报告]
发表于 2012-03-05 14:26 |只看该作者
man ps

看到-L的解释说:
-L              Show threads, possibly with LWP and NLWP columns

看起来只是多出2列,并没有说明为啥会多出很多行结果

论坛徽章:
0
4 [报告]
发表于 2012-03-05 15:01 |只看该作者
ps -ef只打印进程,而ps -eLf会打印所有的线程,同时加了两列。例如:
[root@centos6 ~]# ps -ef | grep rsyslogd
root      1470     1  0  2011 ?        00:01:13 /sbin/rsyslogd -c 4
root     29865 28596  0 22:45 pts/5    00:00:00 grep rsyslogd
[root@centos6 ~]# ps -eLf | grep rsyslogd
root      1470     1  1470  0    5  2011 ?        00:00:00 /sbin/rsyslogd -c 4
root      1470     1 28631  0    5 Mar04 ?        00:00:04 /sbin/rsyslogd -c 4
root      1470     1 28632  0    5 Mar04 ?        00:00:01 /sbin/rsyslogd -c 4
root      1470     1 28633  0    5 Mar04 ?        00:00:04 /sbin/rsyslogd -c 4
root      1470     1 28636  0    5 Mar04 ?        00:00:00 /sbin/rsyslogd -c 4
root     29867 28596 29867  0    1 22:45 pts/5    00:00:00 grep rsyslogd
rsyslogd这个进程有5个线程,所以ps -ef只有一行,而ps -eLf就有5行。

论坛徽章:
0
5 [报告]
发表于 2012-03-05 16:19 |只看该作者
回复 4# libran108


那么一些和Linux资源相关的限制,譬如  ulimit -a,   /etc/secerity/limit.conf
之类的一些譬如:
soft proc
hard proc

之类的限制,是对进程数的限制,还是对线程数的限制?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP