How to get a debug output from the find command

debugfindscripting

I have the following find command:

find /home/  -type d -name "something"

what I want to achieve is to know which directory/file is checked by the find command no matter the fact that it does or does not match the name I have set.

Basically I want to see every action that the find command will perform once I launch the above piece of code.

Thank you!

Best Answer

With an

lsof -p `pidof find`

you can see, where is your find command currently.

With a

strace -p `pidof find`

you can check, what it is doing currently.

None of them have really beautiful output - they are debug tools, but the little bit of learning their output is also really useful.