Changes

Jump to: navigation, search
File Permissions
'''<span style="font-style:italic">Octal (Absolute) Method:</span>'''
[[Image:octal-permissions.png|thumb|right|150px|using octal numbers to represent setting file permissions.]]
You can also use '''octal numbers''' to represent permissions. This method is a short-cut and may require less typing than using the ''symbolic'' method. You can only use this method to '''set''' file permissions (as opposed to ''add'' or ''remove'' permissions.
Since 1 octal digit represents 3 binary digits, one octal digit can represent the <span style="font-family:courier;font-weight:bold;">rwx</span> permission granted or NOT granted. The permissions '''rwx''' are be in the form of 3 binary digits (1 represents the permission granted and 0 represents the permission NOT granted).
'''NOTE:''' You can only use this method to '''set''' file permissions (as opposed to ''add'' or ''remove'' permissions).
<table cellpadding="5" width="70%"><tr><th style="border-bottom: 1px solid black;text-align:left;">Command</th><th style="border-bottom: 1px solid black;text-align:left;">Description</th></tr><tr valign="top"><td width="40%"><span style="font-family:courier;font-weight:bold;">chmod 500 script.bash</span></td><td>Set read and execute permissions for only the '''user''' for the file '''script.bash''' so it can be run.</tr><tr valign="top"><td><span style="font-family:courier;font-weight:bold">chmod 711 ~</span></td><td>Set "'''pass-thru'''" permissions of your '''home''' directory for same group members and other group members to navigate to other subdirectories (that may have access / view permissions).</tr><tr valign="top"><td><span style="font-family:courier;font-weight:bold;">chmod 750 ~/shared</span></td><td>Set full permissions for user, read and access permissions for some group members and no permissions for other group members for the directory '''~/shared'''</td></tr><tr valign="top"><td><span style="font-family:courier;font-weight:bold;">chmod 555 myfile.txt</span></td><td>Set read and execute permissions for the directory '''myfile.txt'''</td></tr></table>
13,420
edits

Navigation menu