pavement

Numeric permissions

From FreeBSDwiki
Revision as of 03:07, 12 September 2004 by Dave (Talk | contribs)
Jump to: navigation, search

Contents

How permissions are defined

File permissions are shown when you do an ls -l on a file or directory:

Description

The green circle highlights the first bit, which tells you if the file is a regular file (with a -), a directory (with d) or a link (with l). The next three bits show you the permissions on the file for the file's owner or user. The next three show you permissions for the group the file belongs to. The last three show you permission for others -- anyone who is not the file owner or member of the group is other.

Permissions bits read r (the file can be read), w (the file can be written to), or x (the file is executable); a - in the place of any of those means that that bit is set to off.

Context is everything

Note that the directories are set as executable for both user and group members. You have to "execute" a directory when you cd into it as well as (somewhat more importantly) when you search it.

How default permissions are set

Which permissions you file are created under by default are set by your umask, which is often set in your shell configuration file (.bashrc, .bash_profile, .cshrc, .tcshrc, etc. -- can also set your umask by just running umask).

Changing file permissions

You can change the permissions of a file with chmod and the owner/group of a file with chown (group can also be set with chgrp).

Personal tools