Search iEntry News

UnixProNews
SecurityProNews
ITmanagement








Optimizing Your Top Experience

By Bryan Young
Expert Author
Article Date: 2010-11-02

For a long time after I began working in a Unix environment, I was using the top command right out of the box, because that was all I knew. I knew that I could get my machine's load average and memory usage, and other information about running processes, but that was it.

It wasn't until I dug a little deeper that I was able to really appreciate top for all that it was worth.

The best place to start when learning something new is in the help section, so go ahead and run top. Now press h to open up the "Help for Interactive Commands" menu. You will see a long list of commands that you can run in the main screen to change how the data is displayed. For instance, to toggle colors, you press z, s or d will let you change the refresh interval, and 1 will show the usage for each processor core as opposed to a summary.

The interactive commands I find most useful are i, k, and u. The i command will toggle the display of idle tasks, so I can see which processes are actually using resources versus what is just sitting there waiting. The k lets me kill any process without leaving the top interface. The u command is one of my favorites, as it lets you look at the processes being run by a specific user.

Another useful feature is the ability to change the sort priorities of the processes. For instance, the default is to sort by CPU usage, but let's say you want to see what is using the most memory. Simply press F (capitalization matters) and you open up a new menu, where all the sort options are listed. Press the letter next to %MEM and press Enter, and you will be taken back to the main screen where the processes are ordered top to bottom by the percentage of memory they are using.

Comments

About the Author:
Bryan Young is a staff writer for WebProNews.



Newsletter Archive | Article Archive | Submit Article | Advertising Information | Resources | About Us | Contact

UnixProNews is an iEntry, Inc. ® publication - All Rights Reserved Privacy Policy and Legal