title: Watch a file for change
body: <p>I want to watch any changes to a file xyz.txt and email me the entire file whenever there is a change. Is there One Liner (or a few lines shell script) for this?</p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code># Check if my.cnf has been changed in the last 24 hours
  # if yes, as in the following case, simply send the file
  # if it has not been changed in the last 24 hours, do nothing.
  
  # find /etc/ -name my.cnf -mtime 0
  /etc/my.cnf
  
  # cat /etc/my.cnf | mail shantanu@company.com
  </code></pre>
  
  <p>Now if someone can show how to bind these two lines in a shell script or in 1 command.</p>