Shell syntax(2)

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

  1. Take out the union of two files (only one copy of duplicate lines is kept)
  2. Take out the intersection of two files (leave only files that exist in both files)
  3. Delete the intersection and leave other rows

  4. cat file1 file2 | sort | uniq
  5. cat file1 file2 | sort | uniq -d
  6. cat file1 file2 | sort | uniq -u

Guess you like

Origin blog.51cto.com/14954090/2540797