Top 命令使用

批处理模式,支持结果重定向到一个文件
    -b : Batch mode operation
        Starts top in 'Batch mode', which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit
    you've set with the '-n' command-line option or until killed.
    显示的帧数
    -n : Number of iterations limit as: -n number
        Specifies the maximum number of iterations, or frames, top should produce before ending.

    两帧显示的间隔
    -d : Delay time interval as: -d ss.tt (seconds.tenths)
    Specifies the delay between screen updates, and overrides the corresponding value in one's personal configuration file or the startup default. Later this can be changed with the 'd' or 's'
interactive commands.

    top配置文件(保存当前状态为top的启动配置)    PERSONAL Configuration File(个性化配置文件)
    This file is written as '$HOME/.your-name-4-top' + 'rc'. Use the 'W' interactive command to create it or update it.

    Here is the general layout:
    global # line 1: the program name/alias notation
    " # line 2: id,altscr,irixps,delay,curwin
    per ea # line a: winname,fieldscur
    window # line b: winflags,sortindx,maxtasks
    " # line c: summclr,msgsclr,headclr,taskclr

    If the $HOME variable is not present, top will try to write the personal configuration file to the current directory, subject to permissions.

分线程查看指定进程CPU占用

    top -H -p 进程号

posted @ 2013-01-09 23:47  dzqabc  阅读(350)  评论(0编辑  收藏  举报