Linux系统进程查看命令-ps | IT运维网
  • 本站启用了账户登录密码错误就锁定模式,如有人误操作被锁请邮件(yvan.lu@ityww.cn)告知我账户名。
  • 本站为个人技术性站点,上面会更新一些系统、网络、虚拟化及云计算等相关的文章,与大家一起参考、学习和交流。
  • 欢迎访问本网站;本站QQ交流群:654792529;如果您觉得本站非常有看点,那么赶紧使用Ctrl+D收藏吧!

Linux系统进程查看命令-ps

Linux 基础 yvan 8年前 (2017-04-23) 3454次浏览 已收录 0个评论 扫描二维码
格式:ps [options]
    u:以用户为中心组织进程状态信息显示
    a:与终端相关的进程
    x:与终端无关的进程
    f:优化进程显示模式
    -e:显示所有进程
    -f:显示完整格式的程序信息
    aux –sort:排序显示
        -%cpu:按CPU占用率升序排序
        -%men:按内存占用率升序排序
        -rss:按内存使用量升序排序
常用组合:aux(auxf)、–ef
[root@localhost ~]# ps auxf
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          2  0.0  0.0      0     0 ?        S    Sep05   0:00 [kthreadd]
root          3  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [ksoftirqd/0]
root          5  0.0  0.0      0     0 ?        S<   Sep05   0:00  \_ [kworker/0:0H]
root          6  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [kworker/u256:0]
root         58  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [kworker/1:1]
root         77  0.0  0.0      0     0 ?        S<   Sep05   0:00  \_ [deferwq]
root         78  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [kworker/3:1]
root        112  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [kauditd]
root        254  0.0  0.0      0     0 ?        S<   Sep05   0:00  \_ [ata_sff]
root        256  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [scsi_eh_0]
root        257  0.0  0.0      0     0 ?        S<   Sep05   0:00  \_ [scsi_tmf_0]
root        258  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [scsi_eh_1]
root        260  0.0  0.0      0     0 ?        S<   Sep05   0:00  \_ [scsi_tmf_1]
root        262  0.0  0.0      0     0 ?        S<   Sep05   0:00  \_ [mpt_poll_0]
root        264  0.0  0.0      0     0 ?        S<   Sep05   0:00  \_ [mpt/0]
root        270  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [scsi_eh_2]
root       1325  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [kworker/0:2]
root       1326  0.0  0.0      0     0 ?        S    Sep05   0:00  \_ [kworker/0:0]
root       1341  0.0  0.0      0     0 ?        S    00:01   0:00  \_ [kworker/2:2]
root       1342  0.0  0.0      0     0 ?        S    00:07   0:00  \_ [kworker/2:1]
root          1  0.0  0.0 191296  4224 ?        Ss   Sep05   0:02 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root        376  0.0  0.0  39076  3496 ?        Ss   Sep05   0:00 /usr/lib/systemd/systemd-journald
root        400  0.0  0.0  44788  2404 ?        Ss   Sep05   0:00 /usr/lib/systemd/systemd-udevd
root        661  0.0  0.0  55508   896 ?        S<sl Sep05   0:00 /sbin/auditd
root        684  0.0  0.0  26376  1732 ?        Ss   Sep05   0:00 /usr/lib/systemd/systemd-logind
root        685  0.0  0.0 223552  5536 ?        Ss   Sep05   0:00 /usr/sbin/abrtd -d -s
root        734  0.0  0.0 110088   852 tty1     Ss+  Sep05   0:00 /sbin/agetty --noclear tty1 linux
root        970  0.0  0.0 216376  4476 ?        Ssl  Sep05   0:00 /usr/sbin/rsyslogd -n
root        971  0.0  0.0 112812  4276 ?        Ss   Sep05   0:00 /usr/sbin/sshd -D
root       1275  0.0  0.0 157208  5888 ?        Ss   Sep05   0:02  \_ sshd: root@pts/0
root       1277  0.0  0.0 115436  2040 pts/0    Ss   Sep05   0:00      \_ -bash
root       1343  0.0  0.0 155460  1948 pts/0    R+   00:07   0:00          \_ ps auxf
root        973  0.0  0.2 573816 17172 ?        Ssl  Sep05   0:01 /usr/bin/python -Es /usr/sbin/tuned -l -P
root       1176  0.0  0.0  89632  2084 ?        Ss   Sep05   0:00 /usr/libexec/postfix/master -w
postfix    1198  0.0  0.0  89736  4048 ?        S    Sep05   0:00  \_ pickup -l -t unix -u
postfix    1199  0.0  0.0  89804  4080 ?        S    Sep05   0:00  \_ qmgr -l -t unix -u
root       1337  0.0  0.0 123256   764 ?        Ss   00:01   0:00 /usr/sbin/anacron -s
[root@localhost ~]# ps -ef
UID         PID   PPID  C STIME TTY          TIME CMD
root          1      0  0 Sep05 ?        00:00:02 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root          2      0  0 Sep05 ?        00:00:00 [kthreadd]
root          3      2  0 Sep05 ?        00:00:00 [ksoftirqd/0]
root          5      2  0 Sep05 ?        00:00:00 [kworker/0:0H]
root          6      2  0 Sep05 ?        00:00:00 [kworker/u256:0]
root          7      2  0 Sep05 ?        00:00:00 [migration/0]
root          8      2  0 Sep05 ?        00:00:00 [rcu_bh]
root          9      2  0 Sep05 ?        00:00:01 [rcu_sched]
root         10      2  0 Sep05 ?        00:00:00 [watchdog/0]
root         11      2  0 Sep05 ?        00:00:00 [watchdog/1]
root        257      2  0 Sep05 ?        00:00:00 [scsi_tmf_0]
root        258      2  0 Sep05 ?        00:00:00 [scsi_eh_1]
root        260      2  0 Sep05 ?        00:00:00 [scsi_tmf_1]
root        262      2  0 Sep05 ?        00:00:00 [mpt_poll_0]
root        264      2  0 Sep05 ?        00:00:00 [mpt/0]
root        270      2  0 Sep05 ?        00:00:00 [scsi_eh_2]
root        660      2  0 Sep05 ?        00:00:00 [kworker/2:1H]
root        661      1  0 Sep05 ?        00:00:00 /sbin/auditd
root        684      1  0 Sep05 ?        00:00:00 /usr/lib/systemd/systemd-logind
root        685      1  0 Sep05 ?        00:00:00 /usr/sbin/abrtd -d -s
root        687      1  0 Sep05 ?        00:00:00 /usr/sbin/irqbalance --foreground
polkitd     691      1  0 Sep05 ?        00:00:00 /usr/lib/polkit-1/polkitd --no-debug
root        692      1  0 Sep05 ?        00:00:00 /usr/bin/VGAuthService -s
root       1277   1275  0 Sep05 pts/0    00:00:00 -bash
root       1320      2  0 Sep05 ?        00:00:00 [kworker/2:0]
root       1325      2  0 Sep05 ?        00:00:00 [kworker/0:2]
root       1326      2  0 Sep05 ?        00:00:00 [kworker/0:0]
root       1337      1  0 00:01 ?        00:00:00 /usr/sbin/anacron -s
root       1341      2  0 00:01 ?        00:00:00 [kworker/2:2]
root       1342      2  0 00:07 ?        00:00:00 [kworker/2:1]
root       1344   1277  0 00:08 pts/0    00:00:00 ps -ef
[root@localhost ~]# ps aux --sort -%cpu
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root        693  0.1  0.0 298708  6072 ?        Ssl  Sep05   0:09 /usr/bin/vmtoolsd
root          1  0.0  0.0 191296  4224 ?        Ss   Sep05   0:02 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root          2  0.0  0.0      0     0 ?        S    Sep05   0:00 [kthreadd]
root          3  0.0  0.0      0     0 ?        S    Sep05   0:00 [ksoftirqd/0]
[root@localhost ~]# ps aux --sort -%mem
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root        973  0.0  0.2 573816 17172 ?        Ssl  Sep05   0:01 /usr/bin/python -Es /usr/sbin/tuned -l -P
polkitd     691  0.0  0.1 538432 10060 ?        Ssl  Sep05   0:00 /usr/lib/polkit-1/polkitd --no-debug
root        712  0.0  0.1 556308  9316 ?        Ssl  Sep05   0:00 /usr/sbin/NetworkManager --no-daemon
root        692  0.0  0.0  99652  6120 ?        Ss   Sep05   0:00 /usr/bin/VGAuthService -s
root        693  0.1  0.0 298708  6072 ?        Ssl  Sep05   0:09 /usr/bin/vmtoolsd
root       1275  0.0  0.0 157208  5888 ?        Ss   Sep05   0:02 sshd: root@pts/0
root        685  0.0  0.0 223552  5536 ?        Ss   Sep05   0:00 /usr/sbin/abrtd -d -s
root        713  0.0  0.0 221232  4732 ?        Ss   Sep05   0:00 /usr/bin/abrt-watch-log -F BUG: WARNING: at WARNING: CPU: INFO: possible recursive loc
root        970  0.0  0.0 216376  4476 ?        Ssl  Sep05   0:00 /usr/sbin/rsyslogd -n
root        971  0.0  0.0 112812  4276 ?        Ss   Sep05   0:00 /usr/sbin/sshd -D
[root@localhost ~]# ps aux --sort -rss
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root        973  0.0  0.2 573816 17172 ?        Ssl  Sep05   0:01 /usr/bin/python -Es /usr/sbin/tuned -l -P
polkitd     691  0.0  0.1 538432 10060 ?        Ssl  Sep05   0:00 /usr/lib/polkit-1/polkitd --no-debug
root        712  0.0  0.1 556308  9316 ?        Ssl  Sep05   0:00 /usr/sbin/NetworkManager --no-daemon
root        692  0.0  0.0  99652  6120 ?        Ss   Sep05   0:00 /usr/bin/VGAuthService -s
root        693  0.1  0.0 298708  6072 ?        Ssl  Sep05   0:09 /usr/bin/vmtoolsd
root       1275  0.0  0.0 157208  5888 ?        Ss   Sep05   0:02 sshd: root@pts/0
root        685  0.0  0.0 223552  5536 ?        Ss   Sep05   0:00 /usr/sbin/abrtd -d -s
root        713  0.0  0.0 221232  4732 ?        Ss   Sep05   0:00 /usr/bin/abrt-watch-log -F BUG: WARNING: at WARNING: CPU: INFO: possible recursive loc
root        970  0.0  0.0 216376  4476 ?        Ssl  Sep05   0:00 /usr/sbin/rsyslogd -n
root        971  0.0  0.0 112812  4276 ?        Ss   Sep05   0:00 /usr/sbin/sshd -D

IT运维网 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Linux系统进程查看命令-ps
喜欢 (2)
yvan
关于作者:
聪明来自勤奋、知识在于积累、好记性不如烂键盘!

您必须 登录 才能发表评论!