Write−Protecting a File

If you revoke users' write permissions for a file, they can no longer write to or remove the file. This effectively "write−protects" a file, preventing accidental changes to it. A write−protected file is sometimes called a "read only" file.

To write−protect a file so that no users other than yourself can write to it, use chmod with `go−w' as the operation.
· To write−protect the file `cruise' so that no other users can change it, type:

$ chmod go−w cruise RET

Make file private

To make a file private from all other users on the system, use chmod with `go=' as the operation. This revokes all group and other access permissions. · To make the file `cruise' private from all users but yourself, type:

$ chmod go= cruise RET

Make file public

To allow anyone with an account on the system to read and make changes to a file, use chmod with `a+rw' as the operation. This grants read and write permission to all users, making the file "public." When a file has read permission set for all users, it is called world readable, and when a file has write permission set for all users, it is called world writable. To make the file `cruise' both world readable and world writable, type:

$ chmod a+rw cruise RET

Posted on: 16/12/2009








0 Comments
If you want to leave a comment please Login or Register