awk, sed, grep and regular metacharacters Description

Transfer: https://blog.csdn.net/hh5820/article/details/80728331

A, grep, sed, awk Overview
grep: text filters, filter if only text, you can use grep, its efficiency is much higher than other
sed: Stream EDitor, stream editor, only the default processing mode space, does not deal with the original data, if you're dealing with processing for the line, you can use sed
awk: report generator, after the display format. If the data processing necessary to generate the report information or the like, or data processing you are processed by the column, is preferably used awk

  • grep

 Linux systems grep command is a powerful text search tool, you can use a regular expression search text, and print out the matching rows. grep stands for Global Regular Expression Print, represents the global regular expression version, it is all the user permissions

  • and

sed is an online editor that processes a row content. Handling, storing the row currently being processed in a temporary buffer, called a "model space" (pattern space), followed by treatment with the contents of the buffer sed command, the processing is completed, the contents of the buffer sent to the screen. Then the next line, which is repeated until the end of the file. File contents not changed, unless you use redirection to store the output. Sed is mainly used to automatically edit one or more documents; simplify repeated operation of the document; write conversion procedures.

  • awk

awk is a powerful text analysis tool, relative to grep to find, edit sed of, awk in its data analysis and report generation, is particularly strong. Awk is to simply read the file line by line, as the default delimiter spaces each row of slices, cut portions then various evaluation. 
There are three different versions of awk: awk, nawk and gawk, have not been specified, generally refers to gawk, gawk is the GNU AWK version
two, regular expression metacharacters Description

Guess you like

Origin blog.csdn.net/orangefly0214/article/details/91883365