zoukankan      html  css  js  c++  java
  • Linux ps -ef和ps aux的区别

    Linux ps -ef和ps aux的区别

    ps -ef 是用标准的格式显示进程的、其格式如下

    monarch-t@monarcht-pc:/$ ps -ef
    UID         PID   PPID  C STIME TTY          TIME CMD
    root          1      0  0 17:00 ?        00:00:03 /sbin/init
    root          2      0  0 17:00 ?        00:00:00 [kthreadd]
    root          3      2  0 17:00 ?        00:00:00 [ksoftirqd/0]
    root          5      2  0 17:00 ?        00:00:00 [kworker/0:0H]
    root          7      2  0 17:00 ?        00:00:01 [rcu_sched]
    root          8      2  0 17:00 ?        00:00:00 [rcu_bh]
    root          9      2  0 17:00 ?        00:00:00 [migration/0]
    root         10      2  0 17:00 ?        00:00:00 [watchdog/0]
    root         11      2  0 17:00 ?        00:00:00 [watchdog/1]
    root         12      2  0 17:00 ?        00:00:00 [migration/1]
    ... ...
    

    其中各列的内容意思如下
    UID //用户ID、但输出的是用户名
    PID //进程的ID
    PPID //父进程ID
    C //进程占用CPU的百分比
    STIME //进程启动到现在的时间
    TTY //该进程在那个终端上运行,若与终端无关,则显示? 若为pts/0等,则表示由网络连接主机进程。
    CMD //命令的名称和参数


    ps aux 是用BSD的格式来显示、其格式如下

    monarch-t@monarcht-pc:/$ ps -aux
    USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root          1  0.1  0.1  34032  4572 ?        Ss   17:00   0:03 /sbin/init
    root          2  0.0  0.0      0     0 ?        S    17:00   0:00 [kthreadd]
    root          3  0.0  0.0      0     0 ?        S    17:00   0:00 [ksoftirqd/0]
    root          5  0.0  0.0      0     0 ?        S<   17:00   0:00 [kworker/0:0H]
    root          7  0.0  0.0      0     0 ?        S    17:00   0:01 [rcu_sched]
    root          8  0.0  0.0      0     0 ?        S    17:00   0:00 [rcu_bh]
    root          9  0.0  0.0      0     0 ?        S    17:00   0:00 [migration/0]
    root         10  0.0  0.0      0     0 ?        S    17:00   0:00 [watchdog/0]
    root         11  0.0  0.0      0     0 ?        S    17:00   0:00 [watchdog/1]
    root         12  0.0  0.0      0     0 ?        S    17:00   0:00 [migration/1]
    root         13  0.0  0.0      0     0 ?        S    17:00   0:00 [ksoftirqd/1]
    
    

    同ps -ef 不同的有列有
    USER //用户名
    %CPU //进程占用的CPU百分比
    %MEM //占用内存的百分比
    VSZ //该进程使用的虚拟內存量(KB)
    RSS //该进程占用的固定內存量(KB)(驻留中页的数量)
    STAT //进程的状态
    START //该进程被触发启动时间
    TIME //该进程实际使用CPU运行的时间

    本文出自T-大帅的博客,转载必须注明出处。 https://www.cnblogs.com/Monarch-T/
  • 相关阅读:
    用python对汉诺塔动态的实现
    用python语言算π值并且带有进度条
    turtle库的学习笔记
    Leetcode 230 二叉搜索树中第k小的元素
    Leetcode 665 非递减数列
    Leetcode 1423 可获得的最大点数
    Leetcode 222 完全二叉树的节点个数
    Leetcode 1208尽可能使字符串相等
    Leetcode 199 二叉树的右视图
    Leetcode 634 子数组最大平均数
  • 原文地址:https://www.cnblogs.com/Monarch-T/p/10388522.html
Copyright © 2011-2022 走看看