Marco Education fourth day file permissions, bash, grep, egrep

Source: Internet
Author: User
Tags clear screen egrep

4.1.1, chmod Modify Owner permissions (-U (Master),-G (group),-O (Other),-a (all)),--reference reference the specified file permissions assigned to the need to modify the file, for example: chmod--reference=/etc/ Inittab/tmp/123.txt,-R (recursively modifies all file permissions in the directory). Chown User:group can simultaneously modify the owner and the group, Umask user to create default permissions values (Directory is 777-umask, file 666-umask (file permissions minus umask If there is execute permission will add 1 on the corresponding permissions))
4.1.2, Ctrl + A: Jump to the command line, Ctrl+e: Jump to the end of the command, Crtl+u: Delete the cursor to the beginning of the content, Crtl+k: Delete the cursor at the end of the content, Crtl+l: Clear screen, Crtl+c: Terminate, crtl+ Z: Send commands to the background to run.

4.2.1, procedural programming language control statements (sequential execution, selection execution, loop execution), scripting: A control mechanism provided by the human-computer interface that lists the commands you wish to execute together in a file. Bash has no libraries, and the entire program relies on command completion. Compiled (source program---preprocessing, compilation----) also known as static language, interpreted type (source program, interpreter to read execution) is also called Dynamic language. A compiled program is built into a binary program without relying on the compiler to run independently, and the interpreted type cannot run independent from the interpreter.
4.2.2, bash variables: Local variables (valid only for the current shell process, other shell and child shell processes are not valid), environment variables (current shell and child shell processes are valid, other shell processes are invalid, export name), Local variables (valid for a shell script snippet), positional variables, special variables: variables with special meaning ($?).
4.2.3, Variable assignment: Saves the data name=value to the variable space. Variable reference: Read the variable spatial data echo ${name}. Undo variable: unset name. Read-only variable: readonly name (variable values cannot be modified and revoked when set to read-only variables). View all variables in the current shell process: Set, view the current shell environment variables: export, printenv, env
4.2.4, variable types: integers, floating-point numbers (single-and double-precision), character types (char, string). There are different mechanisms for defining different types of variables: for example (18 save integer 00010010, save as character to convert 1 and 8 to ASCII for saving). Bash is a weak type: Save variable way everything is character
4.2.5, Bash Profiles: Profile: Provides configuration for interactive login users (global:/etc/profile and/etc/profile.d/*.sh, Personal: ~/.bash_profile,), BASHRC class: Providing configuration for non-interactive users (global:/ETC/BASHRC, Personal: ~/.BASHRC)
4.2.6, Login type: Interactive (1. Log in using the account password via the terminal, 2), non-interactive (1. Login via Su userename, 2. Terminal opened under Graphics, 3. When the script is automatically executed). Modify the configuration file to take effect: Exit login again or reread the configuration file with source. Interactively read the order of configuration files (/etc/profile,/etc/profile/*.sh, ~/.bash_profile, ~/.BASHRC,/ETC/BASHRC), non-interactive (~/BASHRC,/ETC/BASHRC,/ etc/profile/*.sh)

4.3.1, grep (Global search REgular expression and Print out of the line), search by user-specified mode: grep--color=auto ' root '/etc/passwd ,-v reverse display,-O does not display matching rows to show only matches to,-I ignores case,-e supports extended regular expressions,-an,-bn,-CN displays before and after n rows
4.3.2, Regular expression metacharacters: (. Any single character, any single character within the specified range of [], any single character outside the inverse range of [^], any length of the preceding character, \ \ 0 or 1 occurrences of the previous character, specified number of occurrences of the previous character), \{m,n\ The previous character appears at least m times, up to n times,. * Any character of any length, the start of the line anchor, the end of the row anchor, ^$ for blank lines, words that do not contain special characters are anchored (\<, \> end Anchor,), group symbol \ (\). \ n refers to nth matched content.

4.4.1, egrep do not need to write a translator such as:? {} () the first and final anchors still require a translator (\<, \>), and more +: Indicates that the previous character appears at least once, | or

Marco Education fourth day file permissions, bash, grep, egrep

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.