此命令的作用是什么:top -bHn 1 -u mail?

此命令的作用是什么:top -bHn 1 -u mail?
top -bHn 1 -u mail

我已阅读手册页,似乎其中有些内容未包含在手册页中。向我指出其他文档也会有所帮助。特别是,我不确定 1 在做什么或发送邮件。谢谢!

答案1

man 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.

   -H : Threads toggle
        Starts top with the last remembered 'H' state reversed.  When
        this  toggle is On, all individual threads will be displayed.
        Otherwise, top displays a  summation  of  all  threads  in  a
        process.

   -n : Number of iterations limit as:  -n number
        Specifies  the  maximum  number of iterations, or frames, top
        should produce before ending.

   -u : Monitor by user as:  -u somebody
        Monitor only processes with an effective  UID  or  user  name
        matching that given.

因此,这意味着以批处理模式运行(-b),切换线程显示(-H),进行单次迭代(-n 1),仅显示属于用户的进程mail-u mail):基本上是当前线程的一次性快照mail,或多或少相当于ps -Lfu mail

相关内容