Back to Top

Utilizing power of TOP command in Linux

Updated 15 April 2014

We use TOP command for monitoring the CPU utilization of our system. Running from a command line we can view information regarding CPU and memory usage, the number of running processes, load. Here is the output of the top command…..

topNow if we want some system administration utility run and collect system information and write it to a log file periodically. we can do it via crontab or a script.

But i have a better and much simpler solution to do this job.

# top -b -d 5 -n 4 >> top_log_file

-b —- top running in batch mode

Start your headless eCommerce
Find out More

-d —– delay (refresh after 5 seconds and default is 3 seconds).

-n — number of iterations.

we will get a log file named “top_log_file”

# vim top_log_file


so this is how we can run top command in batch mode also for administrative purpose.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home