Attributes of Folders
When you call a list of folders by command ls -l, then the attributes of folders
are performed in order: directory (or folder), rights r, w, x for owner, group and other, owner name and group name.
For example:
-rwxr--r-- 1 hai hai 2144Mar 29 21:44 test.htm
drwxr-xr-x 3 hai hai 4096Mar 29 21:55 xdir
Change the attributes:
Thay đổi thuộc tính
- Change owner:
- chown <username> <filename>
- chgrp <groupname> <filename>
- Setup rights to access folder:
After creating folder, you use command umask <number> to
setup rights to access the folder for u: user; g: group o: other) with the
group of numbers in umask below:
Binery | Rights |
0 | Read and Write (and Excutive for Dir) |
1 | Read and Write |
2 | Read (and Excutive for Dir) |
3 | Read |
4 | Write (and Excutive for Dir) |
5 | Write |
6 | Excutive for Dir |
7 | No rights |
|
There are two ways of changing rights for folder:
- chmod [u|g|o] [+|-] [r|w|x] filename
- Absolutely setup: chmod <number> filename
|