Derek Zeng

A programmer

Top command is actaully pretty useful

by coderek

After I switched to ubuntu, I discovered quite a few useful commandline utilities.

Top is one of them that I underestimated for a long time. In the past, whenever I want to check system resource usage, I'll open system monitor GUI. But top is entirely capable of doing everything system monitor has to do even inside terminal window and it does it better.

Here is a screenshot of top showing my processes with threads.

I am impressed on how it arranged processes according to parent child relationships. From the image I can see that, my java process has forked out about 20 threads to do its job. The RES indicate resident memroy usage. They are the same for all my java threads because they have same process parent.

With top I can easily filter by user (u), search by process name (l), sort by different columns, kill processes and much more. (It's a quick replacement for ps aux and kill combo)

I even can create different views to monitor processes based on differnt attributes.

This shows 4 monitors based on different configs. You can easily save whatever settings you have now by pressing W. Very easy to use!

(End of article)