Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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.

1 Answer 1

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.

share|improve this answer

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