Nine, group management and rights management
9.1 Linux set a basic introduction
Each user in Linux must belong to a group, outside the group do not operate independently. In Linux every file there, where the group concept in all groups, other groups.
File / directory owner: is the owner who created
View: ls -ahl
Modify: chown username filename
Group created:
Basic instructions: groupadd group name
File / directory's group
Modify: chgrp group file name
Other groups
In addition to user and file owner's group, and other users of the system are the other group of files
Change the user's group
usermod -g group name Username
usermod -d directory name of the user to change the user login name of the initial directory
9.2 Introduction of basic rights
Ls -l display contents as follows
-rwxrw-r-- 1 root root 1213 Feb 2 09:39 abc
0-9 Bit Description
Bit 0 is determined file type (d directory, - a normal file, character device C, b block file)
- regular file
b block file
Positions 1-3 to determine the owner (owner of the file) have access to the file
r: read (file) read (directory)
w: writable (files) can be modified (directory)
x: can be executed (file) can enter the directory (directory)
The first 4-6 determine the owning group (the same group of users) have access to the file
7-9 to determine the position of other users have access to the file
Modify the permissions -chmod
By chmod command, you can modify the permissions of a file or directory
The first way: +, -, = change permissions
u: owner g: Owner o: other people a: Everyone
- chmod u = rwx, g = rx, o = x file directory name
- chmod o + w file directory name
- chmod ax file directory names
The second way: by changing the digital rights
Rule: r = 4 w = 2 x = 1, rwx = 4 + 2 + 1 = 7
chmod u = rwx, g = rx, o = x file directory name
Equivalent to chmod 751 file directory names
Modify the file owner -chown
Owner chown newowner file change file
chown newowner: nowgroup file and change the owner of all groups of users
-R If it is a directory then all child files or directories recursively into force
Modify the file's group -chgrp
All group chgrp newgroup file change file
Ten, timed task scheduling
crond task scheduling
Task Scheduler: refers to a specific command or program execution system at a time
Task scheduling classification: 1 2. The system works individual users work
crontab [options]
-e: Edit crontab scheduled tasks
-l: Query crontab task
-r: delete all the current user's crontab tasks