Differenc between ps -ef and top


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Differenc between ps -ef and top
# 1  
Old 09-05-2008
Power Differenc between ps -ef and top

First of all i really thankful to all those people who have created this site.
unix.com rocks man!!

I am bit confused about the two commands which are 'top' and 'ps -ef'.Smilie
My requirement is that i want to monitor the CPU usage of Operating system and if the CPU usage is more than 90% i have to send mail to consern department and if it is more than 95% i have to send the sms.

So for this i have used 'top' command in the shell script but it is not working..that it is not coming out of that command.I have gone through the 'ps -ef' command in this forum but i am not able to get the excat difference between 'top' and 'ps -ef' command.
please help out..Smilie
Thanks in Advance!Smilie
# 2  
Old 09-05-2008
`ps` returns a process listing, `top` runs continuously (but at your option just a particular number of times) and orders the process listing by the criteria you select.
# 3  
Old 02-12-2009
you can use sar for that


i.e.: sar 2 2

this will do the cpu test 2 times in a 2 secs interval
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Use of expr to calc differenc ein to epoch values

Hi folks, I have a script where i am trying to calc the difference between two epoch dates and then have a condition based on the resultant value. When I run the script it keeps complaining; expr: syntax error ./testdiff.sh: line 11: syntax error in conditional expression ./testdiff.sh:... (25 Replies)
Discussion started by: jonnyd
25 Replies

2. Post Here to Contact Site Administrators and Moderators

Top 10 posts

Hi, I selected an option to remove Top ten posts in the main page of our forum. How shall i get back Top ten posts? (2 Replies)
Discussion started by: anbu23
2 Replies

3. AIX

Need a list of top 10 CPU using processes (also top 10 memory hogs, separately)

Okay, I am trying to come up with a multi-platform script to report top ten CPU and memory hog processes, which will be run by our enterprise monitoring application as an auto-action item when the CPU and Memory utilization gets reported as higher than a certain threshold I use top on other... (5 Replies)
Discussion started by: thenomad
5 Replies

4. AIX

Top command in AIX 4.2 (no topas, no nmon, no top)?

Is there a 'top' command equivalent in AIX 4.2 ? I already checked and I do not see the following ones anywhere: top nmon topas (1 Reply)
Discussion started by: Browser_ice
1 Replies

5. UNIX for Dummies Questions & Answers

Help using top and ps

help! i need help with locating where a program is being run from. when i type top -i it only lists the name and minimal info, not the programs location from where it is being ran. i ask because i just used the same named executable, a.exe for all the processes and have lost the schedule detailing... (4 Replies)
Discussion started by: shabs1985
4 Replies

6. HP-UX

Using TOP

Hey guys, the top format in HP-UX has the size which is the total virtual size and the res which is the resident size. What are these size and res? (1 Reply)
Discussion started by: sbn
1 Replies

7. Shell Programming and Scripting

Differenc between print and echo

can anyone explain me what is the difference between echo and print in shell programming? (3 Replies)
Discussion started by: chandhar
3 Replies

8. Solaris

Top

How to display and update information about the top processes on the system(like "top" in Unix ) (1 Reply)
Discussion started by: iwbasts
1 Replies

9. HP-UX

HP-UX and 'top'

I've been working with an HP-UX system (RP5400 Series PA-RISC server) for about a year that hosts some middleware. The middleware sits between an Oracle DB (on another box) and the client applications running on about 800 PCs. From the beginning, I've noticed that 'top' reports between 0.0% and... (8 Replies)
Discussion started by: deckard
8 Replies

10. UNIX for Dummies Questions & Answers

How Can I Have Top Display The Top 20 Processes??

how can i do that in a script withough havin the script halt at the section where the top command is located. am writign a script that will send me the out put of unx commands if the load average of a machine goes beyond the recommended number. top -n 20 i want to save this output to a file... (1 Reply)
Discussion started by: TRUEST
1 Replies
Login or Register to Ask a Question