from my blog https://awkiscool.quora.com/

Every program has a "current working directory".

The following will list all of the current "current working directories" and how many processes are in each one.

For Linux:

readlink /proc/*/cwd|sort|uniq -c

For all Unixes, including Mac OSX:

lsof|grep cwd|awk '{print $9}'|sort|uniq -c

Topic revision: r1 - 2016.05.21 - PaulReiber
 
Copyright © is by author. All material on this collaboration platform is the property of its contributing author.