Numeric permissions
(→How permissions are defined) |
(→How default permissions are set) |
||
Line 13: | Line 13: | ||
==How default permissions are set== | ==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]]). | + | Which permissions you file are created under by default are set by your [[umask]], which is often set in your [[shell]] configuration file ([[.profile]], [[.bashrc]], [[.bash_profile]], [[.cshrc]], [[.tcshrc]], etc. -- it can also set your [[umask]] by just running [[umask]]). |
==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 [[chgrp]]). | 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 04:34, 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 (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 (.profile, .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).