who modified my file!!

Hi EVERYONE!!...

Just a simple (yet critical from my perspective) doubt... I would like to know who had edited my file.. when I use
ls -l
command, I see my ID.. but when I edit using some other ID, I had expected that ID to be shown.. but still
ls -l
shows my ID only..

So, is there any command thru which I can see who had edited my file. I have a serious problem here, since the file has been edited at an "unearthly" time..

Any early responses is highly appreciated..

Thanks in advance..

Regards,
Mohan.

PS: By the way, I cannot, by rule, prevent others from editing (using chmod command)

Unix allows you to give three levels of permissions to the file.
a. Owner
b. Group
c. Others

When we do a ls -lt, the following is a sample output.

-rwxrwxrwx 1 vijay dev 4692060 Oct 13 17:22 core

The above file (core) the owner user is "vijay" and owner group is "dev". (vijay user is part of dev group. also dev group has other users as well).

rwxrwxrwx is the files permissions. The first three 'rwx' corresponds to the 'owner' user. The next three to the 'group' (all users within that group) and the last three is for all others.

So in the above example all (the owner i.e. user vijay, all users belonging to group 'dev' and all others have read, write and execute permissions)

When i change the permission as 'chmod 640 core', the permission becomes 'rw_r_____'. (Note - the owner of the file only can change the permission using chmod)

So now
user 'vijay' has permissions to read and write
all users under group dev have permissions to read
all other users do not have any permissions on the file.

So you can give permissions (if you are the owner) accordingly as to who all (users) can modify the file.

I am not aware of any command in Unix which will give you the user who last edited the file.

Thanks for a elaborated info Goutham... yep.. u seem to be true.. there are no way to find.. and the trouble is that its not possible for me to allocate groups too.. :mad:

Some versions of unix filesystems support acl - access control lists.

try
man chacl
or
man acl

to see if your system does supprt them. If it does then you can create very fine-grained access control for your files.

try with ls -lg filename.ext