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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can we get the list of users who accessed a file Chanakya.m Shell Programming and Scripting 2 09-18-2007 02:58 AM
How to obtain list of users ? bobby36 UNIX for Dummies Questions & Answers 7 04-09-2007 09:34 PM
list users current path Gandalf77 UNIX for Advanced & Expert Users 1 09-29-2006 05:14 AM
Trying to get list of logged on users sorted kungfuice Shell Programming and Scripting 7 07-26-2006 11:35 AM
Find users using system(List them only once) xBuRnTx UNIX for Dummies Questions & Answers 3 10-03-2005 03:37 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-29-2006
Registered User
 

Join Date: Sep 2006
Posts: 4
List current paths of users

Looking for a command which shows the current path of other users.
Similiar to the PWD command.

Need to be able to see which part of the system the user is logged on to.

Thanks
G
Reply With Quote
Forum Sponsor
  #2  
Old 09-29-2006
Registered User
 

Join Date: Sep 2006
Location: Detroit, Michigan
Posts: 23
Quote:
Originally Posted by Gandalf77
Need to be able to see which part of the system the user is logged on to.
Any reason "ps -ef" wouldn't work?
Reply With Quote
  #3  
Old 10-01-2006
Registered User
 

Join Date: Sep 2006
Posts: 4
ps -ef shows the latest command, not always the path.
enter the command and look at your own session and you will just see ps- -ef, not the path.

eg.

redback 1396838 1085518 0 Sep 22 - 0:00 /at1/uv/redback/server/redb
vryandrl 1400832 1441954 4 05:55:01 pts/1 0:00 ps -ef


First one shows the path, the second is my session, no path.
Reply With Quote
  #4  
Old 10-01-2006
Registered User
 

Join Date: Sep 2006
Posts: 9
I don't think there is a command that will show you this information directly. If that is the case, you might have to get there indirectly using "lsof" or some other means.

lsof (short for list-open-files) lists open files on the system. You can use the "-u" option to specify to list files open by the specified user.

Try "lsof -u fred|grep -iw cwd" to list files currently open by user fred which are of the type "current working directory" (cwd). That pretty much tells you what you want to know. Check out the man page for lsof, it has a lot of other options as well.

The fuser command might also be useful. This lists processes (and login names) that are using a specific file or directory.
If you want to know who is using files in /app or is who is "in" /app, "fuser -c -u /app" would tell you that.
Reply With Quote
  #5  
Old 10-02-2006
Registered User
 

Join Date: Sep 2006
Posts: 4
Thanks Rowan,

This helps a lot, I really need to know if he is in one directory or not, so fuser will get me what I need.

re
andy
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0