Get the App
SLTechnology News&Howtos  ›  Servers  › 

Regular expressions and three Musketeers-2

Shulou Source: shulou.com Published: 2022-06-02 10:37:52 10月03日 Update

Awk

Take a paragraph (column) and will not change the contents of the saved file

1. Option

-F specifies the delimiter, and the default space is the delimiter

two。 Printout matching lines

1) commands similar to sed

2) match the key words in one or more columns and print the corresponding rows

3) matching rows (matching rows), printing all columns of matching rows

4) eligible rows (matching rows), printing some columns of matching rows

3. Print some columns of all rows

1) print all columns in all rows, and $0 represents all columns

2) print multiple columns in all rows, separated by commas between columns in the format

3) define the delimiter

4. Print some columns in the matching row

5. Built-in variables for awk

1) NF represents the number of columns of rows

2) NR indicates the line number

6. Add up a column of all the lines in the file

Tags: Separator file condition between content variable command format space comma key line number output three Musketeers regular expression Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Apple MySQL Shulou Tech Info Shulou Information