linux命令大全之ps命令详解(查看进程结果)(3)
实例8:找出与 cron 与 syslog 这两个服务有关的 PID 号码 命令:ps aux | egrep '(cron|syslog)' 输出: 代码如下: [root@localhost test6]# ps aux | egrep '(cron|syslog)' root 2682
实例8:找出与 cron 与 syslog 这两个服务有关的 PID 号码
命令:ps aux | egrep '(cron|syslog)'
输出:
代码如下:
[root@localhost test6]# ps aux | egrep '(cron|syslog)'
root 2682 0.0 0.0 83384 2000 ? Sl Nov02 0:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
root 2735 0.0 0.0 74812 1140 ? Ss Nov02 0:00 crond
root 17475 0.0 0.0 61180 832 pts/0 S+ 16:27 0:00 egrep (cron|syslog)
[root@localhost test6]#
其他实例:
1. 可以用 | 管道和 more 连接起来分页查看
命令:ps -aux |more
2. 把所有进程显示出来,并输出到ps001.txt文件
命令:ps -aux > ps001.txt
3. 输出指定的字段
命令:ps -o pid,ppid,pgrp,session,tpgid,comm
输出:
代码如下:
[root@localhost test6]# ps -o pid,ppid,pgrp,session,tpgid,comm
PID PPID PGRP SESS TPGID COMMAND
17398 17394 17398 17398 17478 bash
17478 17398 17478 17398 17478 ps
[root@localhost test6]#
- 上一篇:Linux文件系统中的inode节点详细介绍
- 下一篇:linux系统的文件属性详解
收藏文章
精彩图集
精彩文章