how to know the current path
in the system , there are many user are logining and working in the shell , if I would like to know which path the specific user is working now ( eg. may be the user is cd to /tmp and working in it , what I hope to do is to know the user is working in /tmp ) , would advise what can I do ?
thanks |
Hi,
To find all the processes with /tmp as the current working directory, this may help: Code:
lsof|egrep ' cwd +DIR +.+ /tmp' Regards, Clifford |
Quote:
if I would like to know the which path ( not only /tmp ) the specific user is working , what can I do ? thanks |
Have a look at the lsof command and it's man page please.
"lsof -d cwd" will show you the Current Working Directory (CWD) for each process on the system, irrespective of where that directory is. |
Another approach: as root, run:
Code:
ls -ld /proc/*/cwd |
All times are GMT -5. The time now is 06:25 AM. |