Objective
What the hell is a shell? Before this, we should understand the issue of file permissions
Body
- Shell version
Various versions:
Bourne Shell (SH), C Shell (CSH), and Korn Shell (Ksh)
And at present:
The common and CentOS default shell is bash (Bourne Again Shell)
Can be considered as the upgrade of SH, enhanced version.
Programmer-"Shell (various versions), graphical interface (think of it)-" operating system-"hardware
- File permissions
1. View File Permissions Ls-l
2.1-Bit Description permissions
?
Three three See
RWX represents both read and write execution.
Encounter-represents no such permission
?
First bit: To distinguish between a file or a directory or another device
-Represents an ordinary file
D stands for the directory
?
Second to fourth bit: User's permissions on the file owner
Fifth to seventh bit: Group User rights
Eighth to tenth bit: other users
?
?
- Change permissions
There are three kinds of permissions for files in Linux
R: Reading (read) Number 4
W: Write number 2
X: Execute (EXECUTE) Number 1
RWX on behalf of the very cock right
?
chmod 777 AA
chmod u+x file name//assign permission to owner X
+ Delegate Assignment permission-on behalf of DELETE permission
chmod g+x to group users
chmod O+x to other users
?
You can also set permissions by numbers
Chmod u
- Operation
1. Create a shell folder
mkdir Shell
2. Create a test.c source file
CD shell
Vim test.c
#include <stdio>
Int Main () {
???? printf ("hello\n");
???? return 0;
}
Gcc-o Test test.c
3. Create a single AA file
Vim AA
Echo "Hello Shell"
Echo $PATH
./test
4. Modify AA to be operational permission
chmod u+x
5. Running
./AA
?
End
The shell script AA is writing a bunch of commands, files with executable permissions
12. Start the shell script