sorted processes


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sorted processes
# 1  
Old 05-15-2007
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
# 2  
Old 05-15-2007
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.
# 3  
Old 05-15-2007
Code:
ps -eo pid,user,args,vsz --sort vsz

# 4  
Old 05-18-2007
Because there is no ps -o command on unix.

Any ideas ??
# 5  
Old 05-18-2007
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 05:50 PM..
# 6  
Old 05-18-2007
On your system, which command do you use to display the processes and their size ?

Jean-Pierre.
# 7  
Old 05-19-2007
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Matrix to 3 col sorted

Hello experts, I have matrices sorted by position, there are 400k rows, 3000 columns. ID CHR POS M1 M2 M3 M4 M5 ID1 1 1 4.6 2.6 2.1 3.5 4.2 ID2 1 100 3.6 2.9 3.2 2.6 2.5 ID3 1 1000 4.1... (9 Replies)
Discussion started by: senhia83
9 Replies

2. Shell Programming and Scripting

Uniq code in sorted order

Hi All, A small question: I have a file check.txt which looks like below: KRPROD2,2012-11-20 08:46:50:408,ODK3325688102 KRPROD2,2012-11-20 08:47:35:289,ODK3325688102 KRPROD2,2012-11-20 08:47:35:446,ODK3325688102 KRPROD2,2012-11-20 08:48:32:973,ODK3325689120 KRPROD2,2012-11-20... (8 Replies)
Discussion started by: irfanmemon
8 Replies

3. UNIX for Dummies Questions & Answers

Help with printing sorted expression

Hi All, How can I print the sorted results of the following expression in Perl ?? print "$i\t$h{$i}\n"; I tried print (sort ("$i\t$h{$i}")"\n"); and other variations of the same but failed. Can someone suggest how to solve this problem, as I'm tryin print sorted results of my script, which... (11 Replies)
Discussion started by: pawannoel
11 Replies

4. UNIX for Dummies Questions & Answers

numerically sorted filenames

How do you sort filenames: 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 as: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: kenneth.mcbride
6 Replies

5. UNIX for Advanced & Expert Users

Sorted file

Hi Is there any unix shell command or utility to know if the file is sorted or not? Thanks (3 Replies)
Discussion started by: ksailesh
3 Replies

6. Solaris

Identifying and grouping OS processes and APP processes

Hi Is there an easy way to identify and group currently running processes into OS processes and APP processes. Not all applications are installed as packages. Any free tools or scripts to do this? Many thanks. (2 Replies)
Discussion started by: wilsonee
2 Replies

7. Shell Programming and Scripting

Compare 2 sorted files

Hi all, please give me the commands using which i can compare 2 sorted files and get the difference in third file, indiating where the difference is from either file1 or file2. as: File1 (Original file) GARRY JOHN JULIE SAM --------------- File2 DEV GARRY JOHN JOHNIEE (7 Replies)
Discussion started by: varungupta
7 Replies

8. UNIX for Advanced & Expert Users

Monitoring Processes - Killing hung processes

Is there a way to monitor certain processes and if they hang too long to kill them, but certain scripts which are expected to take a long time to let them go? Thank you Richard (4 Replies)
Discussion started by: ukndoit
4 Replies

9. UNIX for Dummies Questions & Answers

Inserting in sorted rows

Hello Friends, I have a file with many many rows and I want to insert some numbers in between numbers. The number must be inserted in "correct sorted order". 1. Input = 1055555 0000001 1000000 1055555 <-insert here 3000000 4000000 5000000 8000000 2. Input = 4000080 0000001... (1 Reply)
Discussion started by: buddyme
1 Replies

10. Shell Programming and Scripting

Trying to get list of logged on users sorted

I'm trying to execute a single shell command that will give me a sorted list of all the users currently logged into the system, displaying the users name as it appears in /etc/passwd. I've tried awk -F: '{print $1}' /etc/passwd | xargs finger -s | cut -c11-28 | uniq This list whoever does... (7 Replies)
Discussion started by: kungfuice
7 Replies
Login or Register to Ask a Question