How do I capture the out put of "top" to a file?

Updated -

top is a very useful tool to capture information about process running on Linux. Many times this information may need to be captured to a file. This can be done with the following command:

top -b -n1 > /tmp/top.txt

This will run top once write the output to a file and exit.

The command top can also be run so that it will give multiple repor...

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content