Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Newbie
Reload this Page how to store output of top command
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Newbie If you're new to the wonderful world of Linux, start here!

Closed Thread
 
Thread Tools Display Modes
Old 03-20-2003   #1 (permalink)
Kapil
Just Joined!
 
Join Date: Dec 2002
Posts: 11
how to store output of top command

I want to gather data regarding the CPU, MEM utilization (which i can get using top command), how can i store the top command output in a file, infact how can i make a cronjob to do this status updation automatically say after every half an hour so that it will help me to understand
the strength of the server resources like Memory, CPU etc.

After storing top command output in file, i want to kill this top command process also (becoz top command itself takes a bit of memory/cput using)


thanks for any help in advance.
Kapil is offline  
Old 03-20-2003   #2 (permalink)
Dolda2000
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,575
You might want to check out the sysstat package.
If you don't find that to your liking, you want to check out these commands:
Code:
uptime
free
ps --no-headers -A -o "%cpu sz ucomm" | sort +0r | head
Since you can put anything you want into the output sepc to ps, this is quite flexible.
The you can put it in a cron job or wherever you want to.

But like I said, check out the sysstat package first of all.
Dolda2000 is offline  
Old 12-03-2007   #3 (permalink)
srinilinux
Just Joined!
 
Join Date: Aug 2007
Location: Bangalore
Posts: 1
You can follow the steps mentioned below to see the data by top command simultaneously when you run your program.( These steps do not tell how to log the top command.)
- run your program (.exe) in the Foreground, This should be a lengthy process
- Press CTRL+z (not CTRL+c) , this will put your (.exe) into background. You can verify this using ps command.
- now issue the top command while your (.exe) is running in the backend
- Monitor the CPU Utilization
- Now, if you want to revert back to see what (.exe) is doing you can do the reverse of above steps,
That is,
- Press CTRL+z (not CTRL+c) , this will put top into background, and your prompt returns
- Now issue fg command which will put the (.exe) process into foreground

-Srinivas.B.N
srinilinux is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
2.6 kernel under slackware 10.1 questions Weedman The Linux Kernel 3 11-16-2005 10:34 AM
Problem with Docbook-xml-dtd jessdog Gentoo Linux Help 8 06-11-2005 04:57 PM
installing superkaramba liljhand Linux Applications 17 02-01-2005 11:01 PM




All times are GMT. The time now is 07:48 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0