need help - processes and directories

Jeff Macdonald jeff.macdonald at virtualbuilder.com
Wed Aug 13 13:31:51 EDT 2003


On Wed, 2003-08-13 at 11:07, michael.odonnell at comcast.net wrote:
> > Is there a way I can find out what processes are 'sitting' in
> > a directory?  For example a program that has used chdir to get to
> > a particular directory?
> >
> > I thought lsof would be able give me that info, but I am unable
> > to find the correct option if it can.
> 
> 
>    for every PID of interest
>    do
>       if symlink /proc/$PID/cwd points at $directoryOfInterest
>       then
>          You found one...
>       fi
>    done

Excellent!

Here's my modified version:

cd /proc
ls -l [0-9]*/cwd | grep <dir of interest>





More information about the gnhlug-discuss mailing list