zoukankan      html  css  js  c++  java
  • 几个常用的ps命令

    1. ps aux

    If you are looking for a short summary of the active processes, use  ps aux

    [root@rhel7 tmp]# ps aux |head
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.3  44496  7124 ?        Ss   Jun27   0:01 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
    root         2  0.0  0.0      0     0 ?        S    Jun27   0:00 [kthreadd]
    root         3  0.0  0.0      0     0 ?        S    Jun27   0:00 [ksoftirqd/0]
    root         7  0.0  0.0      0     0 ?        S    Jun27   0:00 [migration/0]
    root         8  0.0  0.0      0     0 ?        S    Jun27   0:00 [rcu_bh]
    root         9  0.0  0.0      0     0 ?        S    Jun27   0:00 [rcuob/0]
    root        10  0.0  0.0      0     0 ?        R    Jun27   0:00 [rcu_sched]
    root        11  0.0  0.0      0     0 ?        S    Jun27   0:00 [rcuos/0]
    root        12  0.0  0.0      0     0 ?        S    Jun27   0:00 [watchdog/0]

    2. ps -ef 

    If you are not only looking for the name of the process but also for the exact command that was used to start the process, use ps -ef .

    [root@rhel7 tmp]# ps -ef |head
    UID        PID  PPID  C STIME TTY          TIME CMD
    root         1     0  0 Jun27 ?        00:00:01 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
    root         2     0  0 Jun27 ?        00:00:00 [kthreadd]
    root         3     2  0 Jun27 ?        00:00:00 [ksoftirqd/0]
    root         7     2  0 Jun27 ?        00:00:00 [migration/0]
    root         8     2  0 Jun27 ?        00:00:00 [rcu_bh]
    root         9     2  0 Jun27 ?        00:00:00 [rcuob/0]
    root        10     2  0 Jun27 ?        00:00:00 [rcu_sched]
    root        11     2  0 Jun27 ?        00:00:00 [rcuos/0]
    root        12     2  0 Jun27 ?        00:00:00 [watchdog/0]

    3.ps fax 

    which shows hierarchical relationships between parent and child processes.

    [root@rhel7 tmp]# ps fax | head
      PID TTY      STAT   TIME COMMAND
        2 ?        S      0:00 [kthreadd]
        3 ?        S      0:00  \_ [ksoftirqd/0]
        7 ?        S      0:00  \_ [migration/0]
        8 ?        S      0:00  \_ [rcu_bh]
        9 ?        S      0:00  \_ [rcuob/0]
       10 ?        R      0:00  \_ [rcu_sched]
       11 ?        S      0:00  \_ [rcuos/0]
       12 ?        S      0:00  \_ [watchdog/0]
       13 ?        S<     0:00  \_ [khelper]
  • 相关阅读:
    工具类--map 转成xml xml转成map
    工具类--MD5Utils
    工具类--敏感信息掩码规则
    spring--Springmvc中@Autowired注解与@Resource注解的区别
    工具类--发送验证码短信
    工具类--日期工具类
    工具类--Excel 导出poi
    Jquery mobile中的 checkbox和radio的设置问题
    ASP和JS读写Cookie的问题
    js获取当前用户IP
  • 原文地址:https://www.cnblogs.com/rusking/p/5623669.html
Copyright © 2011-2022 走看看