Numeric permissions
Line 1: | Line 1: | ||
==How permissions are defined== | ==How permissions are defined== | ||
− | permissions are shown when you do an '''ls -l''' on a file or directory: | + | File permissions are shown when you do an '''ls -l''' on a file or directory: |
+ | |||
[[Image:Permissions-example.png|thumb|Description]] | [[Image:Permissions-example.png|thumb|Description]] | ||
Line 8: | Line 9: | ||
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. | ||
− | ==Context is everything | + | ==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. | 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. | ||
Line 15: | Line 16: | ||
==Changing file permissions== | ==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 [[ | + | 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]] |
Revision as of 03:06, 12 September 2004
Contents |
How permissions are defined
File permissions are shown when you do an ls -l on a file or directory:
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
this needs:
-a comparison between unix permissions and windows permissions