The owner has read, write, and execute permission, while the group and
other users have only read and execute permissions. As a result, the owner can add, change, or
delete files in that directory, and everyone else can only read the contents, change to that directory,
and list the contents of the directory.
If you own a file, you can use the chmod command to change the permission on it as you please.
In one method of doing this, each permission (read, write, and execute) is assigned a number??”
r=4, w=2, and x=1??”and you use each set??™s total number to establish the permission. For example,
to make permissions wide open for yourself as owner, you??™d set the first number to 7 (4+2+1), and
Change the file??™s content, rename
it, or delete it.
NOTE
72
Linux First Steps Part I
then you??™d give the group and others read-only permission by setting both the second and third
numbers to 4 (4+0+0), so that the final number is 744. Any combination of permissions can result
from 0 (no permission) through 7 (full permission).
Here are some examples of how to change permissions on a file (named file) and what the resulting
permission would be:
# chmod 777 file rwxrwxrwx
# chmod 755 file rwxr-xr-x
# chmod 644 file rw-r--r-
# chmod 000 file ---------
You can also turn file permissions on and off using plus (+) and minus (-) signs, respectively.
Pages:
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231