Home > Solaris > Find a users working directory

Find a users working directory

November 8th, 2009 admin Leave a comment Go to comments

First, perform a w or a who to find out which pseudo-terminal the user is using:

# w | grep "oracle"
oracle   pts/12       Fri 3pm 3days                -bash

Now, we can find out the PID of the shell they’re using:

# ps -ef | grep '[p]ts/12'
  oracle 11918 11916   0   May 18 pts/12      0:00 -bash

Finally, use the pwdx command to find the pwd of the process:

# pwdx 11918
11918:  /var/opt/oracle

Cheers,
Kevin

Categories: Solaris Tags:
  1. No comments yet.
  1. No trackbacks yet.