1. Initial knowledge of the Shell scripting language

Source: Internet
Author: User
Tags readable

  PS: In the Linux system-based STM8 firmware upgrade project, you need to let the CPU through the I²C bus to STM8 transfer data, just start one of the knock, a waste of time, and then consider the shell script, although the shell script is very simple, but the role is not small, Greatly improves the data transmission efficiency.

1. Use of VI Editor

The VI editor has two modes, command mode and input mode. Input command: Vim test.sh, enter, you can enter the command mode, this time can not be edited, you need to input I enter the input mode. After you have entered, press Wq to exit and press Q to exit without saving. (Vim is the enhanced version of VI)

2, to file permissions

Method 1:chmod +x./test.sh indicates that the test.sh file is executable, and if X is changed to R to indicate that the file is readable, the file can be written if x is changed to W.

Method 2:chmod 777./TEST.SH indicates that the owner, the group that belongs to the host, and other users have read, write, and execute permissions.

Permissions are represented by numbers. The encoding rules are as follows: Readable (R) is 4, writable (W) is 2, executable (x) is 1, no permission (-) is 0.

The attributes listed with LS-L will get the genetic characters:-rwxr-xr-x, a total of 10 characters, the first represents the file attributes (d for folders,-for ordinary files), and the remaining 9 are divided into three groups. Three of each group represents R readable W writable x executable. If it is a letter that has this permission, if yes-indicates that the permission is not available. The first group represents the permissions of the file owner, the second group represents the permissions of the group user who is the owner, and the third group represents the permissions of the other users.

 

  

1. Initial knowledge of the Shell scripting language

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.