title: How to check if a file is opened in Linux?
body: <p>The thing is, I want to track if a user tries to open a file on a shared account. I'm looking for any record/technique that helps me know if the concerned file is opened, at run time.</p>
  
  <p>I want to create a script which monitors if the file is open, and if it is, I want it to send an alert to a particular email address. The file I'm thinking of is a regular file.</p>
  
  <p>I tried using <code>lsof | grep filename</code> for checking if a file is open in gedit, but the command doesn't return anything. </p>
  
  <p>Actually, I'm trying this for a pet project, and thus the question.</p>