The 6th chapter of the Book of Bird Brother
File permissions:
^ ^ ^ ^ ^ ^ ^
1 2 3 4 5 6 7
The file has the owner of the file, the concept of the user group the file belongs to.
1.10 letters indicates file permissions are divided into 4 sections
D R_x R_x _ _ _ _
First Letter: Indicates file type
d directory,-file, l connection file, B storage interface device, c serial port device
第2-4个 Letter: Indicates that the file owner's permissions to the file are readable R writable W executable x does not have permission in _
第5-7个 Letter: Represents the user group to which the file belongs permissions
第8-10个 Letter: Indicates the permissions of other users on the file
D R_x R_x _ _ _ Represents a directory, the file owner can read executable, file user group user readable executable, other users unreadable non-writable not executable
2. Number of file connections
3. Owner
4. User groups
5. File Capacity Unit B
6. Last Modified Date
7. File name. Start representing hidden files
To change the properties of a file:
chgrp: Changing the user group to which the file belongs
If you change the Test1.txt to the Users user group: CHGRP users Text1.txt
chown: Changing the file owner can also change the user group and user name
If you change the test1.txt to Kuang User: Chown Kuang text1.txt
Change the test1.txt to the users user group Kuang User: Chown kuang:users test1.txt (can also use. To replace:)
chmod: Changing the permissions of a file
The first permission given with the number R 4 W 2 x 1 is the value in these three numbers
such as chmod test1.txt: The Test1.txt attribute changed to rw-------
Second, the use of symbols
Three types of identities represent U:user G:group o:others A:all
+: Join Permissions-: Remove permissions =: Set permissions
such as chmod u=rwx test1.txt the Test1.txt user rights set to rwx other unchanged
Some other commands to use:
cat: read out file contents such as Cat Test1.txt
su: Switch user identities such as Su Kuang
mkdir: Create new directory
Go to Folder:
Absolute path cd/home/name/name with/start, all paths are typed
Relative path CD./name. Represents the current directory, which represents a sub-file into the current directory
Cd.. Return to the previous level of the directory, note: And there's a space between the CDs.
"Linux" Learning 2