12. Start the shell script

Source: Internet
Author: User

Objective

What the hell is a shell? Before this, we should understand the issue of file permissions

Body
    1. 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

    1. 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

?

?

    1. 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

    1. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.