How to capture the output of a top command in a file in linux?

后端 未结 10 1006
梦如初夏
梦如初夏 2020-12-24 06:14

I want to write the output of a specific \'top\' command to a file. I did some googling and find out that it can be done by using the following command.

top         


        
10条回答
  •  执念已碎
    2020-12-24 06:47

    Here is the 1-liner I like to use on my mac:

    top -o -pid -l 1 | grep "some regexp"
    

    Cheers.

提交回复
热议问题