Commonly used options in shell scripts:
\t is an escape character like \n means a new line, \t means a tab character, to put it bluntly is to press the Tab key when entering information in the text box
\b Backspace
\c display after wrapping is not
\ f at the beginning of a screen displayed on the terminal
\ n newline
\ r carriage return
\ v vertical tab
\ backslash
\ 0nnn represents an ASCII character with 1, 2 or 3 octal integer
Forward and backslashes:
forward slashes /: usually indicate the separator of a string (sometimes also indicate a path)
Backslashes \: usually indicate escape
sed:
interval: a single dash symbol can be used to represent a character interval in a character group. You only need to specify the first character of the interval, the single dash, and the last character of the interval.
[0123456789] means from 0 to 9
[0-9] also means from 0 to 9
Use two existing files to generate a new file
- Take out the union of two files (only one copy of duplicate lines is kept)
- Take out the intersection of two files (leave only files that exist in both files)
-
Delete the intersection and leave other rows
- cat file1 file2 | sort | uniq
- cat file1 file2 | sort | uniq -d
- cat file1 file2 | sort | uniq -u