List current paths of users


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers List current paths of users
# 1  
Old 09-29-2006
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
# 2  
Old 09-29-2006
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?
# 3  
Old 10-02-2006
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.
# 4  
Old 10-02-2006
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.
# 5  
Old 10-02-2006
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List the Manager of Users in AD - Using list- Get-ADuser

Is there any command that can used in Linux that export usernames and their manager's name from AD using bash shell script? I know this can be done using powershell but I need to use Linux for this procedure. (2 Replies)
Discussion started by: dellanicholson
2 Replies

2. Homework & Coursework Questions

Sort current logged in users by log in time (supposedly to be very easy but I'm missing something)

1. The problem statement, all variables and given/known data: Show all users who are currently logged in, sorted from earliest to latest log in time. The log in time includes the month, day, and time. 2. Relevant commands, code, scripts, algorithms: finger, who, sort, pipe, head, tail, ... (8 Replies)
Discussion started by: vtmd
8 Replies

3. Red Hat

Nagios is sending critical false alerts about current users

Hello All, Nagios seems to be sending false alerts about few hosts, (ex: There were no users on one host and still Nagios was reporting a critical alert and says 6 users are logged in. How do I fix this one? Also, I have installed nagios and added 12 hosts as a start and monitoring few... (4 Replies)
Discussion started by: lovesaikrishna
4 Replies

4. AIX

How to list the current ftp connections?

Hello, I need to know How to list the ""current"" ftp connections? the machine is AIX 6.1 Regards Ahmed Amer Cairo,Egypt (5 Replies)
Discussion started by: ahmedamer12
5 Replies

5. UNIX for Dummies Questions & Answers

Determining file size for a list of files with paths

Hello, I have a flat file with a list of files with the path to the file and I am attempting to calculate the filesize for each one; however xargs isn't playing nicely and I am sure there is probably a better way of doing this. What I envisioned is this: cat filename|xargs -i ls -l {} |awk... (4 Replies)
Discussion started by: joe8mofo
4 Replies

6. UNIX for Dummies Questions & Answers

cat a list of directory paths only to a file

Hi! I would like to funnel a series of directories and subdirectories into a text file. This is the output I would like to see from a find command: /mypath/ABC_01/VISIT_01 /mypath/ABC_01/VISIT_02 /mypath/ABC_01/VISIT_03 /mypath/ABC_02/VISIT_01 /mypath/ABC_03/VISIT_01 I've tried: find... (2 Replies)
Discussion started by: goodbenito
2 Replies

7. Red Hat

Current logged in users

I have 2 systems. (1) RHEL5 and (2) winXP pro from xpPRO putty i ssh into rhel5 : user root from xpPRO i ftp into rhel5 : user abc123 when i run #uptime it only shows 1 user when i do #ps -u abc123 : it shows vsftpd deamon PID is there a command that can be used to show all currently... (4 Replies)
Discussion started by: dplinux
4 Replies

8. Shell Programming and Scripting

How to read a list of paths from a file?

Hi everyone! I'm pretty bad at shell scripting and I am trying to create a java launcher. The idea is to store in a configuration file different paths (each for a different java version) and then, run a .sh file that would read the specified java path and execute the .jar file. This is what i have... (7 Replies)
Discussion started by: mostacholoco
7 Replies

9. Solaris

find home directory paths for all users

How to find al the user's home directories? (2 Replies)
Discussion started by: a2156z
2 Replies

10. UNIX for Advanced & Expert Users

list users current path

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 (1 Reply)
Discussion started by: Gandalf77
1 Replies
Login or Register to Ask a Question