进程管理工具使用

pstree、ps、pidof、pgrep、top、htop

一. pstree - display a tree of processes

 1 yum install psmisc //软件包包含命令pstree、killall、fuser 

二.ps - report a snapshot of the current processes

   用法:ps [options]           
                u:以用户为中心组织进程状态信息显示
                a: 与终端相关的进程
                x: 与终端无关的进程       
               -e: 显示所有进程
               -f: 显示完整格式程序信息
               -F: 显示完整格式的进程信息
               -H: 以进程层级格式显示进程相关信息                

实例:

[root@alen ~]# ps aux
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          1  0.0  0.6 193468  6576 ?        Ss   13:49   0:01 /usr/lib/systemd/systemd --switched-root --system
root          2  0.0  0.0      0     0 ?        S    13:49   0:00 [kthreadd]
各条目含义:
    USER: 进程属主
    PID:进程ID
    %CPU: CPU占用时间比
    %MEM: 内存占用时间比
    VSZ:virtual memory size,虚拟内存集
    RSS:ReSident Size,常驻内存集
    TTY: 终端
    START: 进程状态
            R:running
            S:  interruptable sleeping
            D: uninterruptable sleeping
            T: stopped
            Z: zombie

            +: 前台进程
            l:多线程进程
            N:低优先级进程
            <:  高优先级进程
            s:   session leader
    START: 启动时间        
    TIME: 进程占用CPU的累计时长
    COMMAND:进程由哪条命令运行起来的    

猜你喜欢

转载自www.cnblogs.com/ckh2014/p/9567501.html