Possible Duplicate:
How can I determine what process has a file open in Linux?

I have a file in a Linux system that says has been last accessed by the process that created it a couple of hours ago, but I would like to know if that process has already finished writing into the file, or if the file is now basically finished writing. Without knowing anything about the original process, what command can I use to check if it's safe to start reading the data from the file without the danger of it being incomplete?

marked as duplicate by slhck Aug 1 '12 at 10:32

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.


You can try the lsof command. Without knowing anything about the original process, though, this method might not work - for example, if the process closes the file, but then re-openes it for appending.

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