nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

AWK

This is a discussion on AWK within the Shell scripting forums, part of the Development/Scripting category; PLZ HELP "ps -el" command list all the processess of all the terminals or of all the users workin...on terminals... ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 08-26-2006, 04:19 PM
Junior Member
 
Join Date: Aug 2006
Location: del
Posts: 4
Rep Power: 0
preygool
Default AWK

PLZ HELP


"ps -el" command list all the processess of all the terminals or of all the users workin...on terminals...

I want to develope an "awk" program or "awk command" on shell

to summarise from the list of all processes, a count of processes run by every user including root.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-27-2006, 10:57 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,036
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
to summarise from the list of all processes, a count of processes run by every user including root.
No need to use awk use wc -l
Code:
echo "Total running process: $(ps -el | wc -l)"
Let me know if you need any further help
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 08-27-2006, 01:22 PM
Junior Member
 
Join Date: Aug 2006
Location: del
Posts: 4
Rep Power: 0
preygool
Default

but wc -l will just count the total nober of lines in the process...


how will it going to summerise man...


i want a summery of few columns...and then the shud be according to sorted terminal wise or user wise.
Reply With Quote
  #4 (permalink)  
Old 08-27-2006, 06:53 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,036
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

I am not sure what you want you need to explain it little more

You can print out column stuff something as follows
Code:
ps -el | awk '{ print $14}'
Or cound unique process
Code:
ps -el | awk '{ print $14}' | uniq | wc -l
but give me more info what out do you wanna so that i can guide out
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #5 (permalink)  
Old 08-28-2006, 01:50 PM
Junior Member
 
Join Date: Aug 2006
Location: del
Posts: 4
Rep Power: 0
preygool
Default

yes..the way u hv written the first example...

Code:
ps -el | awk '{ print $14}'


this...this is wht i want...


now il'll take few columns like these...but nw i want to to arrange them according to terminal wise....

like first list columns of terminal tty1 then tty2 and so on till tty7...

this is wht i want..nw may be u cn help me nw.
Reply With Quote
Reply

Bookmarks


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 On
Pingbacks are On
Refbacks are On


All times are GMT +5.5. The time now is 05:47 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36