Filtering and Sorting with the Linux Top Command

Filtering and Sorting with the Linux Top Command

top is a command in Linux used to view current processes, CPU, memory, and other information.

1. Filter by User

<span>top</span> and then press <span>u</span> to enter the username you want to view.

2. Filter by Command

<span>top</span> and then press <span>o</span> to enter <span>COMMAND=xxx</span>, which will only display the xxx program.

<span>top</span> and then press <span>o</span> to enter <span>%CPU>2.0</span>, which will only display processes with a CPU percentage greater than 2%.

3. Cancel Filtering

Press <span>=</span> to cancel all filters.

4. Sort by Memory Size

<span>top</span> and then press <span>M</span>.

5. Sort by CPU Usage

<span>top</span> and then press <span>P</span>.

6. Display Detailed Information of COMMAND

<span>top</span> and then press <span>c</span> to display detailed information of the COMMAND.

7. More configurations for top can be set by pressing <span>f</span>, such as hiding or displaying certain columns.

This content only represents the author’s views and does not reflect the platform’s views.

If there are any objections, please feel free to contact us.

If there is any infringement, please contact us for removal.

Filtering and Sorting with the Linux Top Command

Leave a Comment