Forum Moderators: bakedjake

Message Too Old, No Replies

Using the ps command

         

shwetha

10:35 am on Mar 11, 2004 (gmt 0)

10+ Year Member



Hi,

i wanted to know that $ps - gives the list of process.

using the grep and ps command how can i display the processes owned by me.I would really appreciate if the reply is given at the earliest.

Thanks,
Shwetha

davenix

11:04 am on Mar 11, 2004 (gmt 0)

10+ Year Member



if your o/s supports the "whodo" command, you could try

# whodo "username"

This will display the processes of the user for each session they are running.

# ps

with no agruments gives you your process list for your current session.

GeorgeGG

11:21 am on Mar 11, 2004 (gmt 0)

10+ Year Member



Try
ps -ef ¦ grep your_user_name

GeorgeGG

Added:

#!/usr/bin/perl -w

use strict;
use diagnostics;

my @LINES_PS;

print "Content-type: text/html\n\n";

print "\n<HR SIZE=5><B>PS</B>\n";

open(FILE,"ps -ef ¦");
@LINES_PS = <FILE>;
close(FILE);

foreach $line (@LINES_PS)
{
if(index($line, "your_user_name") >= 0)
{
print $line;
}
}