The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-15-2006
beginner1 beginner1 is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 13
ps help

Does anyone know the syntax of the ps command to view all processes of all users currently logged on the system?
  #2 (permalink)  
Old 04-15-2006
beginner1 beginner1 is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 13
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 04:32 PM..
  #3 (permalink)  
Old 04-15-2006
beginner1 beginner1 is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 13
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
  #4 (permalink)  
Old 04-15-2006
amro1 amro1 is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 105
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 06:12 PM..
  #5 (permalink)  
Old 05-15-2006
lhen329 lhen329 is offline
Registered User
  
 

Join Date: Jun 2004
Location: Mobile, AL
Posts: 1
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 03:46 PM.. Reason: Remove email address
  #6 (permalink)  
Old 05-15-2006
royal royal is offline
Registered User
  
 

Join Date: Jul 2004
Location: New York City
Posts: 19
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.

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0