Detect changes in a file

Hi all
Just curious , is it possible to detect changes in a file and sent to email .

For ex: demo.conf

I would like to receive an email everytime a particular file(demo.conf) changes and the content added/removed and who did the change (userid). Is it possible.

Thanks
CK

Yes and no!

You can easily write a script that polls the file statistics every so often and looks for change from the last poll. If the file's changed you can then compare the current file to a previously saved version and email out the differences.
What you can't do is tell who made the change - that info isn't stored.

you can use tools like md5sum, md5,sha1 to check for changes. as for who did it, one of the ways is to turn on auditing on your platform.

In many years of being a Unix user, I've never come across platform auditing! Can you provide some background please?

if you are in Solaris platform, you can turn on BSM. If in Linux, then turn on audit daemon ( auditd)