UNIX systems with
disk quotas (
won't let you change the owner (
of a file;
only the superuser can use
Here's a workaround for those systems.
The file's current owner should make sure that the new owner has write
permission on the directory where the file is and read permission on the
ls -ld . afile
drwxr-xr-x 2 jerry 512 Aug 10 12:20 .
-rw-r--r-- 1 jerry 1934 Aug 10 09:34 afile
chmod go+w .
The new owner (logged in as herself) should rename the file, make a
copy, and delete the original file.
If the new owner is there at the same time,
is probably the fastest way to change accounts:
mv afile afile.tmp
cp -p afile.tmp afile
ls -l afile
-rw-r--r-- 1 laura 1934 Aug 10 09:34 afile
rm -f afile.tmp
chmod go-w .
command preserves the file's original permissions and
last modification time.
After the new owner (
) is done copying, the old owner (
takes away the directory's write permission again.