need help - processes and directories

Kevin D. Clark kclark at CetaceanNetworks.com
Tue Aug 12 14:27:49 EDT 2003


Jeff Macdonald <jeff.macdonald at virtualbuilder.com> writes:

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

lsof | awk "\$4 ~ \"cwd\" && \$NF ~ \"^$YOUR_DIRECTORY\$\" { print }"

Regards,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc




More information about the gnhlug-discuss mailing list