Exit TOP command after 1 min


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Exit TOP command after 1 min
# 1  
Old 08-22-2008
Exit TOP command after 1 min

Hi,

I am running following command: top -p <psid> | grep used

I want to send o/p of above command to some txt file but it do not break as it keeps going. How can I exit 'top -p <psid> | grep used' after certain time like 1 min or 2 mins?
# 2  
Old 08-22-2008
Use the -n option of top.

Regards
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with top command

Currently when i run top command i get the following columns . CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND In this how to remove '%WCPU' column ? Thanks very much in advance . (6 Replies)
Discussion started by: kpravinraj
6 Replies

2. UNIX for Advanced & Expert Users

Equivalents of tee command to find exit status of command

Hi, Want to log the output of command & check the exit status to find whether it succeeded or failed. > ls abc ls: abc: No such file or directory > echo $? 1 > ls abc 2>&1 | tee log ls: abc: No such file or directory > echo $? 0 Tee commands changes my exit status to be always... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies

3. Shell Programming and Scripting

Command to find the Memory and CPU utilization using 'top' command

Hi all, I found like top command could be used to find the Memory and CPU utilization. But i want to know how to find the Memory and CPU utilization for a particular user using top command. Thanks in advance. Thanks, Ananthi.U (2 Replies)
Discussion started by: ananthi_ku
2 Replies

4. Shell Programming and Scripting

command to know files modified morethan 30 min

Hi, i use ksh and want to know the command for gettting the files which were not modified in last 30 min. find . -name <filename > -mtime 0.0209 is not giving the results. Thanks , Mohan (3 Replies)
Discussion started by: mohanpadamata
3 Replies

5. 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

6. Shell Programming and Scripting

top's exit code indicates error--is this a bug?

This single line of code in a sh script file top -b -n 1 -U $USER causes the script to prematurely exit with an exit code of 1 (i.e. an error) if the script is run with the -e option (e.g. if set -e is executed near the top of the script file). Alternatively, you can execute it like top... (8 Replies)
Discussion started by: fabulous2
8 Replies

7. Shell Programming and Scripting

Top command

Hey, Using one single line of command i am trying to show the CPU usage for 4 processors and then filter it out and write it to a text file. Everything seams ok except that i am not able to switch from having the top command show me all CPU processes seperate opposed to showing me the average of... (8 Replies)
Discussion started by: Georgesaa
8 Replies

8. SCO

HP-UX top command

Is there a command in SCO Unix that does the same as the top command in HPUX. The command displays the jobs using the most system resources. Thanks You (0 Replies)
Discussion started by: joestrosser
0 Replies

9. UNIX for Dummies Questions & Answers

top command

hi guys, i am having a dual cpu xeon machine. i came to know that i can view the performance by giving top command. but top command shows only the usage of one cpu in percentage while the process are using more than 100% usage in the list . can i know separately the usage of cpus. can you... (5 Replies)
Discussion started by: bijuhpd
5 Replies

10. UNIX for Dummies Questions & Answers

command --> top

What is the numbers show in a variable "Load Average"? (3 Replies)
Discussion started by: madness
3 Replies
Login or Register to Ask a Question