ps help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ps help
# 1  
Old 04-15-2006
ps help

Does anyone know the syntax of the ps command to view all processes of all users currently logged on the system?
# 2  
Old 04-15-2006
Ok figured out most of it. I am stuck on the following part.
How do i retrieve a user name from the finger command and assign it to a variable. I would like to loop through each user name.

I have used the following so far:


finger | cut -d" " -f 1 > File1

This gives me output such as:
John.Doe
Jane.Doe
Tom.Fictional

How do I get the name assigned to a variable, then cycle on to the next name?

Last edited by beginner1; 04-15-2006 at 05:32 PM..
# 3  
Old 04-15-2006
Not much help from anyone!! Smilie


I have decided to use sed within a while loop, but my code doesnt seem to work. If anyone knows whats wrong with it, please offer a suggestion.


TMP=1
TMP2=5 #TMP2 is the number of lines in the file
while [ TMP -lt TMP2 ]
do
sed -e '$TMP,%d' File1
TMP=`expr $TMP + 1`
done
# 4  
Old 04-15-2006
here...

If you need to see all processes of all users then depending of version of UNIX you run:

ps -ef for Sytem V clones
or
ps -aux for BSD clones

as list of processes may be long you can use "less" or "more"
ps -ef | less
or
ps -aux | less

another way to observe all processes in an organized way is "pstree" command. Please notice that in some system you have to become root to list all processes. If you became "root", you can review all the processes structures in virtual "proc" filesystem at /proc. Get "UNIX Essentials and UNIX Core" DVD, if you have questions of this sort.

Hope it helps.

Last edited by amro1; 04-15-2006 at 07:12 PM..
# 5  
Old 05-15-2006
Larry

Where is the download for Unix or Linix? I am using Windows XP and am cosidering changing my Operating system.
Please send your answer to email address removed

Last edited by Perderabo; 05-15-2006 at 04:46 PM.. Reason: Remove email address
# 6  
Old 05-15-2006
Uh-oh, let's read this rule one more time...

(10) Don't post your email address and ask for an email reply. The forums are for the benefit of all, so all Q&A should take place in the forums.

Smilie
royal
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question