To view the owner of a file, use the "-l" option with "ls". For example:
[tt]
$ ls -l dead.letter
-rw-r--r-- 1 andyb other 2764 Aug 25 16:55 dead.letter
[/tt]
The file is owned by "andyb" and belongs to the group "other". Only two people can change the ownership of the file - "andyb" and "root". This can change, depending upon the permissions on the directory the file is in, so you may need to experiment.
To change the owner of the file use "chown new_owner filename(s)". For example:
[tt]
# Change ownership of a single file.
chown franks dead.letter
# Change ownership of many files.
chown franks /home/franks/projects/*
[/tt]
Hope this helps. [sig]<p> Andy Bold<br><a href=mailto: > </a><br><a href= > </a><br>"I've probably made most of the mistakes already, so hopefully you won't have to..." Me, most days.[/sig]
I have not heard of a method of determining the previous owner of a file.
If you have a tar copy of the file then check the tar with tar tvf file.tar, the result should look like this: -
-rwxrwxrwx 1006/1 1167 Sep 7 12:12 2000 tester
The first number after permisions is the uid, grep the uid from /etc/passwd and you will get the user name. [sig]<p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>Top man[/sig]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.