1. summarize the use of the commands involved in this course and the relevant examples show:
Chmod,chgrp,umask,chown,grep,egrep
2. summarize basic regular expressions and extended regular Expressions
Format:
grep [OPTIONS] PATTERN [FILE ...] :
Options:
--color=auto: The matching string is highlighted; \ \ can be--color directly as the default color
-V: Display mode does not match rows
-I: Ignore character case
-O: Show only strings that can be matched to a pattern
-Q: Silent mode
-E: Using extended regular expressions
1. Basic regular Expression meta-character
.: Matches any single character
*: Matches any of its preceding characters any time
. *: Denotes any character of any length
[]: Any single character within the specified range
[^]: characters other than the specified character
X\{m,n\}: Indicates that the preceding character X appears at least m times, at most n times
X\{m\}: Indicates exact match m times
Note: In the basic regular expression? To be used, the escape character must be added to the front
^: Beginning of line anchor
$: End of line anchor character
\ (\): Group reference
\1: Represents the contents of the first set of parentheses
\2: Represents the contents of the second set of parentheses;
\w: Equivalent to [0-9a-za-z]
\< \b: The first anchor of the word; the left side of the pattern used to denote the word;
\>, \b: the ending anchor; the right side of the pattern used to represent the word
^$: Blank Line
\?:0 or 1 times
\+:1 or more
The metacharacters of the extended regular expression is basically the same as that of the basic regular expression, and the following are the differences:
\ (\) becomes only used () to denote
\{\} to be represented only with {}
+: Indicates that the character before it matches at least once
|: or meaning; for example a|b means A or b is ok
3. display the lines in the/etc/passwd file that end with bash
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5F/wKiom1XhxMqQgGAdAADhv1f0Z3k180.jpg "/>
4. display the two-digit or three-digit number in the/etc/passwd file
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1XhxujQ34xvAAU7YT6LOdY749.jpg "/>
5. display lines with ' LISTEN ' followed by 0, one or more whitespace characters in the ' netstat-tan ' command result
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5F/wKiom1XhxM2Se05mAACuJ0RWhoU423.jpg "/>
6. Add User bash, Testbash, basher, and Nologin user (Nologin user's shell is/sbin/nologin), then find out/etc/ A row in the passwd file that has the same user name as its shell name
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5B/wKioL1XhxurS81jMAACo3vS6Y-o251.jpg "/>7 , display the default shell and UID for root, CentOS, or User1 users on the current system "Please create these users beforehand, if not present"
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/5F/wKiom1XhxM_St5PuAACUyILjKJc770.jpg "/>8 , find the line with a set of parentheses followed by a word "word can be underlined" in the/etc/rc.d/init.d/functions file
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5B/wKioL1Xhxuyht2YWAAFa9dXRhUM831.jpg "/>
9, use echo to output a path, and then egrep find its path base name; Further use Egrep to remove its directory name
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/5F/wKiom1XhxNGDRWsTAABb_nlLksI325.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5B/wKioL1Xhxu7RRMZuAAB0FeJVnI0680.jpg "/>
Find the number between 1-255 in the result of the ifconfig command execution
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/5F/wKiom1XhxNLS15ttAAHGV9maSf0984.jpg "/>
Linux OPS Practice-August 27, 2015 Course assignments