ps -ef不能显示所有的进程 怎么解决啊

youthlover 2006-08-31 12:18:53
ps -ef不能显示所有的进程 ,用ps -ef|grep postgres不能看到进程号,但进程是运行的。
top也不能显示CPU个数,本来是两个,显示一个。
还有,有的文件总是闪烁不定,应该是文件定向不准。
请问怎么解决啊,什么原因导致的啊?



[root@localhost init.d]# ps -ax
PID TTY STAT TIME COMMAND
1 ? S 0:04 init
5 ? SWN 0:02 [ksoftirqd_CPU0]
6 ? SWN 0:00 [ksoftirqd_CPU1]
11 ? SW 0:00 [bdflush]
13 ? SW 0:00 [mdrecoveryd]
75 ? SW 0:00 [khubd]
2659 ? S 0:00 syslogd -m 0
2663 ? S 0:00 klogd -x
2806 ? S 0:00 /usr/sbin/sshd
2923 ? S 0:00 gpm -t imps2 -m /dev/mouse
2934 ? S 0:00 /usr/sbin/httpd
2955 ? S 0:00 crond
2963 ? S 0:00 [httpd]
2964 ? S 0:00 [httpd]
2965 ? S 0:00 [httpd]
2966 ? S 0:00 [httpd]
2967 ? S 0:00 [httpd]
2968 ? S 0:00 [httpd]
2969 ? S 0:00 [httpd]
2970 ? S 0:00 [httpd]
2974 ? S 0:00 cupsd
3018 ? S 0:00 [jserver]
3109 ? S 0:00 [xfs]
3116 ? S 0:00 /bin/sh /etc/rc3.d/S93gk start
3117 ? S 0:00 initlog -q -c /root/MindSys/vss/ss3000-v
3118 ? S 0:00 /root/MindSys/vss/ss3000-v
3147 ? S 0:07 [VSS]
3162 ? S 0:00 /usr/bin/perl /usr/local/em5000/bin/em5000_dog.pl -c /usr/local/em5000/bin/em5000.ini -p /usr/local/em500
3163 ? S 0:00 sh -c /usr/local/em5000/bin/em5000 -c /usr/local/em5000/bin/em5000.ini -p /usr/local/em5000/bin/license.d
3164 ? S 0:20 /usr/local/em5000/bin/em5000 -c /usr/local/em5000/bin/em5000.ini -p /usr/local/em5000/bin/license.dat --p
3177 ? S 0:13 /usr/local/bin/procp
3180 tty1 S 0:00 /sbin/mingetty tty1
3181 tty2 S 0:00 /sbin/mingetty tty2
3182 tty3 S 0:00 /sbin/mingetty tty3
3183 tty4 S 0:00 /sbin/mingetty tty4
3184 tty5 S 0:00 /sbin/mingetty tty5
3185 tty6 S 0:00 /sbin/mingetty tty6
3584 ? S 0:00 ./bill
3681 ? S 0:00 ./bill
3696 ? S 0:00 ./bill
4216 ? S 0:00 /usr/local/psionic/portsentry/portsentry -tcp
4224 ? S 0:00 /usr/local/psionic/portsentry/portsentry -udp
10828 ? S 0:00 /usr/sbin/sshd
[root@localhost init.d]# ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1368 472 ? S 08:45 0:04 init
root 5 0.0 0.0 0 0 ? SWN 08:45 0:02 [ksoftirqd_CPU0]
root 6 0.0 0.0 0 0 ? SWN 08:45 0:00 [ksoftirqd_CPU1]
root 11 0.0 0.0 0 0 ? SW 08:45 0:00 [bdflush]
root 13 0.0 0.0 0 0 ? SW 08:45 0:00 [mdrecoveryd]
root 75 0.0 0.0 0 0 ? SW 08:45 0:00 [khubd]
root 2659 0.0 0.0 1444 548 ? S 08:46 0:00 syslogd -m 0
root 2663 0.0 0.0 1364 424 ? S 08:46 0:00 klogd -x
root 2806 0.0 0.0 3504 1500 ? S 08:46 0:00 /usr/sbin/sshd
root 2923 0.0 0.0 1412 444 ? S 08:46 0:00 gpm -t imps2 -m /dev/mouse
root 2934 0.0 0.4 20152 8920 ? S 08:46 0:00 /usr/sbin/httpd
root 2955 0.0 0.0 1424 576 ? S 08:46 0:00 crond
apache 2963 0.0 0.4 20312 9324 ? S 08:46 0:00 [httpd]
apache 2964 0.0 0.4 20364 9420 ? S 08:46 0:00 [httpd]
apache 2965 0.0 0.4 20356 9460 ? S 08:46 0:00 [httpd]
apache 2966 0.0 0.4 20216 9064 ? S 08:46 0:00 [httpd]
apache 2967 0.0 0.4 20312 9324 ? S 08:46 0:00 [httpd]
apache 2968 0.0 0.4 20348 9380 ? S 08:46 0:00 [httpd]
apache 2969 0.0 0.4 20304 9352 ? S 08:46 0:00 [httpd]
apache 2970 0.0 0.4 20360 9420 ? S 08:46 0:00 [httpd]
root 2974 0.0 0.1 8524 2920 ? S 08:46 0:00 cupsd
wnn 3018 0.0 0.1 5156 3920 ? S 08:46 0:00 [jserver]
xfs 3109 0.0 0.2 6328 4784 ? S 08:47 0:00 [xfs]
root 3116 0.0 0.0 4296 1296 ? S 08:47 0:00 /bin/sh /etc/rc3.d/S93gk start
root 3117 0.0 0.0 3512 732 ? S 08:47 0:00 initlog -q -c /root/MindSys/vss/ss3000-v
root 3118 0.0 0.0 1340 284 ? S 08:47 0:00 /root/MindSys/vss/ss3000-v
root 3147 0.0 0.2 16788 5396 ? S 08:47 0:07 [VSS]
root 3162 0.0 0.1 6892 3376 ? S 08:47 0:00 /usr/bin/perl /usr/local/em5000/bin/em5000_dog.pl -c /usr/local/em500
root 3163 0.0 0.0 4160 1056 ? S 08:47 0:00 sh -c /usr/local/em5000/bin/em5000 -c /usr/local/em5000/bin/em5000.in
root 3164 0.1 0.3 18524 6280 ? S 08:47 0:20 /usr/local/em5000/bin/em5000 -c /usr/local/em5000/bin/em5000.ini -p /
root 3177 0.1 0.0 3340 1760 ? S 08:47 0:13 /usr/local/bin/procp
root 3180 0.0 0.0 1348 396 tty1 S 08:47 0:00 /sbin/mingetty tty1
root 3181 0.0 0.0 1348 396 tty2 S 08:47 0:00 /sbin/mingetty tty2
root 3182 0.0 0.0 1348 396 tty3 S 08:47 0:00 /sbin/mingetty tty3
root 3183 0.0 0.0 1348 396 tty4 S 08:47 0:00 /sbin/mingetty tty4
root 3184 0.0 0.0 1348 396 tty5 S 08:47 0:00 /sbin/mingetty tty5
root 3185 0.0 0.0 1348 396 tty6 S 08:47 0:00 /sbin/mingetty tty6
root 3584 0.0 0.0 1360 360 ? S 08:54 0:00 ./bill
root 3681 0.0 0.0 1360 360 ? S 08:55 0:00 ./bill
root 3696 0.0 0.0 1364 364 ? S 08:55 0:00 ./bill
root 4216 0.0 0.0 1388 488 ? S 09:04 0:00 /usr/local/psionic/portsentry/portsentry -tcp
root 4224 0.0 0.0 1392 492 ? S 09:05 0:00 /usr/local/psionic/portsentry/portsentry -udp
root 10828 0.0 0.0 6840 2052 ? S 11:59 0:00 /usr/sbin/sshd
[root@localhost init.d]# ps -ef|grep bill
root 3584 1 0 08:54 ? 00:00:00 ./bill
root 3681 1 0 08:55 ? 00:00:00 ./bill
root 3696 1 0 08:55 ? 00:00:00 ./bill
[root@localhost init.d]# ps -ef|grep postgres
[root@localhost init.d]#
[root@localhost init.d]# ps -ef|grep em5000
root 3162 1 0 08:47 ? 00:00:00 /usr/bin/perl /usr/local/em5000/
root 3163 3162 0 08:47 ? 00:00:00 sh -c /usr/local/em5000/bin/em50
root 3164 3163 0 08:47 ? 00:00:20 /usr/local/em5000/bin/em5000 -c
[root@localhost init.d]# ps -ef|grep port
root 4216 1 0 09:04 ? 00:00:00 /usr/local/psionic/portsentry/po
root 4224 1 0 09:05 ? 00:00:00 /usr/local/psionic/portsentry/po
[root@localhost init.d]# ps -ef|grep postgres
[root@localhost init.d]# service postgresql status
postmaster (pid 6214 3226 3078 3070 3042 2873 2872 2869) is running...
[root@localhost init.d]#
...全文
794 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
aiirii 2006-09-01
  • 打赏
  • 举报
回复
ps auxw
>>|grep postgres就看不到这些进程号
注意大小写的区分

>>top也不能显示CPU个数,本来是两个,显示一个。
新版本的 top,
按 “1”,就可以在多cpu和总cpu 切换了
DanXer 2006-08-31
  • 打赏
  • 举报
回复
你怎么知道没显示全,ps的默认输出行长度只是屏幕的宽度,也许你的命令行较长,所以进程可执行文件名没显示出来,你用grep可能找不到。


ps -Hefj --columns 800|grep -e 'post.*'
试试
at4zhx 2006-08-31
  • 打赏
  • 举报
回复
ps -efwww
youthlover 2006-08-31
  • 打赏
  • 举报
回复
就如postgres这个数据库进程,用service postgresql status可以看到数据库进程有6214 3226 3078 3070 3042 2873 2872 2869这些进程号,而ps -ef|grep postgres就看不到这些进程号。这个服务器昨天上午还能用ps -ef看到这些进程号的。

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧