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

~: ls

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

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

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

~/sasuser.v91: cd a
~/sasuser.v91: ls

~/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)

This will show all directories currently used by users:

fuser -u $(find sasuser.v91 -type d) 2>&1 | grep 'c('

Just create a script to perform that for you

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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