Sed:stream Editor
Read by line, pattern matching, processing display. By default, the source file is not edited, only the data in the pattern space is processed, and then the pattern space is printed.
-N: Silent mode. The content in the pattern space is not displayed.
-I: Modify the source file directly.
-e script-e script: Executes multiple scripts at the same time.
-f/path/to/sed_script: Processes the file using the specified script.
-R: Use extended regular expressions.
Startline,endline: Specifies the starting line to the end line.
LineNumber: Exact a row.
$: Represents the last row.
Startline,+n: The N-line backward from the specified line.
/pattern/: Specifies the mode.
/pattern1/,/pattern2/: The first time the line that is matched by pattern 1 starts to the end of the line that is first matched by pattern 2, and all the rows in the middle.
D: Delete rows that match the criteria.
P: Displays rows that match the criteria.
A \string: Appends a new line to the specified line, with the contents of string.
I \string: Adds a new row before the specified line, with the contents of string.
R file: Adds the contents of the specified file to the line where the condition is met.
W File: Saves content in the specified range to the specified file.
s/pattern/string/modifier: Find and Replace, default replaces only the first string in each line that is matched. You can use "/", "#", "@" as the delimiter.
Modifier:
G: Global substitution.
I: Ignores character case when looking up.
&: References all strings that match.
Linux bash-sed