Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using fuser command to get the list of processes accessing a folder. However if the process is working on a file present in a inner folder, executing fuser command on the parent does not provide details of the process working on inner folder.

Is there any way I can pull the process details of the inner folders as well while executing fuser on the parent?

I am working with Solaris 5.8.

Below is the code which I tried:

~: pwd
/home/ah388

~: ls
sasuser.v91/

~: cd sasuser.v91/
~/sasuser.v91: cat kk.sh
while [ 1 ]; do
echo "" > /dev/null
done;

~/sasuser.v91: ./kk.sh &
[1] 15140

~/sasuser.v91: ls
a/      kk.sh*

~/sasuser.v91: cd a
~/sasuser.v91: ls
kk.sh*

~/sasuser.v91/a: ./kk.sh &
[2] 15271

~/sasuser.v91/a: cd

~: fuser -u sasuser.v91
sasuser.v91:    15140c(ah388880) --> What about 15271 Process

~: jobs
[1]-  Running                 ./kk.sh &  (wd: ~/sasuser.v91)
[2]+  Running                 ./kk.sh &  (wd: ~/sasuser.v91/a)
share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

This will show all directories currently used by users:

fuser -u $(find sasuser.v91 -type d) 2>&1 | grep 'c('
share|improve this answer
add comment

Just create a script to perform that for you

for i in `find directory -type d`
do
 echo $i
 fuser -u $i
done

You can even add a if to see if there is some output and just print the ones with running processes.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.