tutes-dump/site-tutorials/FAQ/UNIX/02

30 lines
1.2 KiB
Plaintext
Executable File

[02] WHAT ARE UNIX FILE PERMISSIONS AND HOW DO THEY WORK?
UNIX treats directories, paging, memory, hardware devices, nearly
everything as a FILE. Files have modes, and here they are explained.
NOTE, this is just basic information and not complete. The following
should be all you need to know about UNIX FILES.
u g o l owner group bytes date file
---------------------------------------------------------------
drwxr-xr-x 7 nova users 352 Jul 11 1992 /udd/nova
UNIX treats everything (devices, directories, et cetera) as a file.
u = user
g = group
o = other (everyone else)
l = links
d = directory
t = sticky bit
p = pipe
owner = the user id who owns the file
group = the group that owns the file
You can use the chown, chmod and chgrp commands to modify files
chmod (change mode) allows you to alter the permissions of a file
using "u,g,o" .. for instance: chmod ou-rx /udd/nova would make
the above file unreadable to other users and users in the "users"
group. chmod ou+rwx /udd/nova would give all other users access
to your directory (read and write).