Follow by Email

Monday, May 23, 2011

What are File Permissions?

  • You can use letters to specify the permissions, with one or more of:
    • u=User (the file owner)
    • g=Group (other users in the file's group)
    • o=Other (everyone else)
    and one or more of:
    • r=Read permission
    • w=Write permission
    • x=Execute (or enter directory) permission
    • (and some more obscure ones, see the manual page)
    For example:

    chmod u-w file...
    Subtract user write permission from the file(s).
    chmod go+rx file...
    Add group-and-other read-and-execute permission for the file(s).

  • Or you can set permissions as an octal number. The permission bits have the meaning specified as in the description for umask below, except that a bit is set in order to give rather than deny permissions.For example, "chmod 640 file..." would set the file(s) to read and write (but not execute) permission for the user, read permission for group, and no permission for anyone else. This is represented as "rw-r-----" by the "ls -l" command.

No comments:

Post a Comment