50.3. Who Will Own a New File?
If
you share files with other users, it's good to be
able to tell who will own each file. On many systems, this is even
more important because only the superuser can
change file ownership (Section 50.14, Section 50.15).
-
When you create a new file, it belongs to you.
-
When you append to a file with
>>file, the owner
doesn't change because Unix doesn't
have to create a new file.
-
When you rename a file with mv,
the ownership doesn't change.
Exception: if you use mv to move a file to another
filesystem, the moved file will belong to you, because to move across
filesystems, mv actually has to copy the file and
delete the original.
-
When you copy a file, the copy belongs to you because you created it
(Section 50.9).
-
When you edit a file:
If you aren't sure, use ls
-l (Section 50.2).
-- JP
 |  |  | 50.2. Tutorial on File and Directory Permissions |  | 50.4. Protecting Files with the Sticky Bit |
Copyright © 2003 O'Reilly & Associates. All rights reserved.
|
|