This question already has an answer here:

The issue is that, one particular flat file is getting created in a directory. I'm not sure which application is creating that flat file. I am using Unix environment.

Is there any possibility to identify which script/binary/application is creating that flat file.

marked as duplicate by Ramesh, Stéphane Chazelas, Bernhard, slm Jul 23 '14 at 14:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    What variant of Unix? What's the output of uname -rs? – Stéphane Chazelas Jul 23 '14 at 13:34
  • I am using HP-UX B.11.11. – SuRa Aug 13 '14 at 9:03

as Gilles answer to this question: How to determine which process is creating a file?

lsof /path/to/file

after you locate the process you can determine the application using ps:

ps -ef | grep ProcessNumber

and to get only the Application use awk:

ps -ef | grep ProcessNumber | awk '{ print $8 }'
  • lsof will not help here if the file has been created and closed by the time lsof is called. On the other hand, LoggedFS may be more helpful as it can display process info when file is created. – fduff Jul 23 '14 at 13:48

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