The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-15-2006
Registered User
 

Join Date: Apr 2006
Posts: 13
Stumble this Post!
ps help

Does anyone know the syntax of the ps command to view all processes of all users currently logged on the system?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-15-2006
Registered User
 

Join Date: Apr 2006
Posts: 13
Stumble this Post!
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 01:32 PM.
Reply With Quote
  #3 (permalink)  
Old 04-15-2006
Registered User
 

Join Date: Apr 2006
Posts: 13
Stumble this Post!
Not much help from anyone!!


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
Reply With Quote
  #4 (permalink)  
Old 04-15-2006
Registered User
 

Join Date: Mar 2006
Posts: 106
Stumble this Post!
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 03:12 PM.
Reply With Quote
  #5 (permalink)  
Old 05-15-2006
Registered User
 

Join Date: Jun 2004
Location: Mobile, AL
Posts: 1
Stumble this Post!
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
__________________
Have you asked Jesus
into your heart?
You must to go to heaven!
What about your kids?
Love yews
Larry n Gwen

Last edited by Perderabo; 05-15-2006 at 12:46 PM. Reason: Remove email address
Reply With Quote
  #6 (permalink)  
Old 05-15-2006
Registered User
 

Join Date: Jul 2004
Location: Brooklyn, NY
Posts: 19
Stumble this Post!
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.

Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:10 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