Linux Command Learning Notes

xiaoxiao2021-03-06  50

First, GREP

1. Run: Search for specific content in the specified file and output the line standard of these content.

2, format

Grep [options]

3, main parameters

[Options] Main parameters:

-C: Only the count of matched rows is output.

-I: Not case sensitive (only for single characters)

-H: The file name is not displayed when querying multi-files.

-L: You only output file names that contain match characters when querying multi-files.

-N: Display matching row and line number.

-S: Do not display error messages that do not exist or have no text.

-V: Displays all rows that do not contain matching text.

Pattern regular expression main parameters:

: Ignore the original meaning of special characters in regular expressions.

^: Match the start of the regular expression.

$: Match the end line of the regular expression.

<: From the row of matching regular expressions.

>: The line ends to match the regular expression.

[]: Single character, such as [a], is a conformity.

[-]: Range, such as [A-Z], that is, A, B, and C, until Z is compliant.

: All single characters.

*: There is a character, the length can be 0.

Two .tar

Role: Package files and unpack files. Package format: TAR ZXCF {target} .tgz source unpacking format: Tar Zxvf file.tgz

转载请注明原文地址:https://www.9cbs.com/read-40689.html

New Post(0)