The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Compare 2 sorted files varungupta Shell Programming and Scripting 7 01-25-2008 09:07 AM
Monitoring Processes - Killing hung processes ukndoit UNIX for Advanced & Expert Users 4 01-17-2008 12:30 AM
Inserting in sorted rows buddyme UNIX for Dummies Questions & Answers 1 10-24-2007 02:26 AM
Need to display sorted output on 1 line! knc9233 UNIX for Dummies Questions & Answers 2 01-17-2007 06:26 PM
comm - sorted result issues krsunderm UNIX for Dummies Questions & Answers 1 11-29-2005 03:36 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2007
pro pro is offline
Registered User
 

Join Date: May 2007
Posts: 3
sorted processes

Hi,
I am trying to make a script that creates a list of all active (alive) processes sorted by size and then print this list on screen.

Could anyone help me?

Thaks a lot
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-15-2007
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,198
You can start with that :
Code:
ps -ef -o user=,pid=,ppid=,vsz=,args= | sort -k4,4n
Read man pages for ps and sort commands.

jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 05-15-2007
Registered User
 

Join Date: Sep 2006
Posts: 1,434
Code:
ps -eo pid,user,args,vsz --sort vsz
Reply With Quote
  #4 (permalink)  
Old 05-18-2007
pro pro is offline
Registered User
 

Join Date: May 2007
Posts: 3
Because there is no ps -o command on unix.

Any ideas ??
Reply With Quote
  #5 (permalink)  
Old 05-18-2007
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,499
There is ps -o in any of the Unix or Unix like OSes I have used recently. And I would be surprised if it were not since it is required by POSIX. There is however no modern operating system simply called 'Unix'

Last edited by reborg; 05-18-2007 at 01:50 PM.
Reply With Quote
  #6 (permalink)  
Old 05-18-2007
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,198
On your system, which command do you use to display the processes and their size ?

Jean-Pierre.
Reply With Quote
  #7 (permalink)  
Old 05-19-2007
pro pro is offline
Registered User
 

Join Date: May 2007
Posts: 3
Quote:
Originally Posted by aigles
On your system, which command do you use to display the processes and their size ?

Jean-Pierre.
I use the command ps -f
The result is something like that :

F S UID PID PPID SZ RECV TTY CMD
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0