Help with top command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with top command
# 1  
Old 05-04-2012
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 .
# 2  
Old 05-04-2012
Are you running in command line mode or interactive mode?
# 3  
Old 05-04-2012
Sorry forgot to mention about that . I am running in command line mode .
# 4  
Old 05-05-2012
I do no believe that there is a way to specify what columns you want in batch mode. You will have to parse the output using awk or a similar tool to remove the unwanted column.
This User Gave Thanks to fpmurphy For This Post:
# 5  
Old 05-05-2012
why not use cut -f command to retrieve only the columns you are interested in? you can use

Code:
cat $1 | while read LINE
do
   echo $LINE | awk -F, '{for(i=1;i<=NF;i++){ print $i }}' | while read WORD
   do
      awk '{$1 $2 $3 $4}'
   done
done

assuming you have dumped the output to a file first and then parse it offline.

Last edited by vbe; 05-10-2012 at 08:52 AM.. Reason: code tags..
This User Gave Thanks to inditopgun For This Post:
# 6  
Old 05-05-2012
Program top comes with a manual; you can read the manual of program top by issuing

man top

after the prompt. In the manual you can find

2b. SELECTING and ORDERING Columns

in which you are instructed to press 'f' (Fields select) or 'o' (Order fields) and then you will be shown a screen containing the current fields string followed by names and descriptions for all fields.

The last paragraph I have just posted comes literally from the manual.
This User Gave Thanks to hexram For This Post:
# 7  
Old 05-10-2012
thanks very much guys
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Top command

Hi All, i am using the below command and once get the output and i need to keep the first batch only.in this case how to do this one. please help me on thistop -b -n 5 >top.txt Thanks, (3 Replies)
Discussion started by: bmk
3 Replies

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

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

4. Shell Programming and Scripting

Top command

Hi , can some one please assist me in using top command im facing following after using top: # top -hv UX:sh (top): ERROR: top: syntax error at line 1: `(' unexpected # top -p UX:sh (top): ERROR: top: syntax error at line 1: `(' unexpected thanks in advance (3 Replies)
Discussion started by: NIMISH AGARWAL
3 Replies

5. Solaris

top command

Hi, How to install software package top in solaris, (4 Replies)
Discussion started by: manoj.solaris
4 Replies

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

7. UNIX for Dummies Questions & Answers

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... (0 Replies)
Discussion started by: Georgesaa
0 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

I understand the numbers displayed in variable "load average". My question: what are the correct/ideal numbers? Sometimes, I got less than 1. Others, above 6. Also, what HW/SW should I tune in order to have the ideal numbers? Thank you ... (1 Reply)
Discussion started by: dgromerog
1 Replies
Login or Register to Ask a Question