pavement

Numeric permissions

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(How default permissions are set)
(How permissions are defined)
Line 5: Line 5:
 
[[Image:Permissions-example.png|thumb|Description]]
 
[[Image:Permissions-example.png|thumb|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''.
+
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 (red circle) show you the permissions on the file for the file's ''owner'' or ''user''. The next three (yellow circle) show you permissions for the group the file belongs to. The last three (blue circle) 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.
 
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.

Revision as of 04:33, 12 September 2004

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 (red circle) show you the permissions on the file for the file's owner or user. The next three (yellow circle) show you permissions for the group the file belongs to. The last three (blue circle) 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. -- it 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