learn Linux sed command one, reference documentation:1. Sed command detailed http://qifuguang.me/2015/09/21/sed%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3/ 2. Linux sed usage http://www.cnblogs.com/dong008259/archive/2011/12/07/2279897.html 3. The man manual parameter of Sed explains in detail (a) http://blog.csdn.net/imfinger/article/details/6071175Ii. The rules for the use of SED commands are: sed [option]'Command'input_file Three, options:-N,--quiet,--Silent Suppress automatic printing of pattern space-E script,--expression=script Add the script to the commands to is executed if there is only one instruction on the command line, do not write it.-E, but if you have more than one instruction, be sure to add it to the front of each instructione option. -F Script-file,--file=script-file Add the contents of script-file to the commands-be executed here looks like the previous corresponding-e-corresponding script--follow-symlinks follow symlinks when processinginch Place-i[suffix],--inch-place[=SUFFIX] Edit filesinchPlace (makes backupifextension supplied)-L-N,--line-length=N Specify the desired line-wrap length forThe ' L'Command--POSIX disable all GNU extensions. -R,--regexp-extended Use extended regular ExpressionsinchThe script. -S,--Separate consider files asSeparate rather than asa single continuousLongStream. -U,--unbuffered load minimal amounts of data fromThe input files and flush the output buffers more often--Help Display ThisHelp and exit--version output version information and exit four, command has the following: a \: Append is appended to the string, a \ followed by the string s (multi-line string can be separated by \ n), the The string s is appended to the currently selected row, and C \: Supersedes/Replace the string, c \ followed by the string s (the multiline string can be separated by \ n), the currently selected row is replaced with the string s; d:delete is deleted, the command deletes the currently selected row, I \: Insert is the string, I \ followed the string s (multirow Strings can be separated by \ n), the string s is inserted before the currently selected line, P:print is printed, and the command prints the currently selected line to the screen; s: Replace, usually the s command uses this:1, 2s/old/New/g, replacing the old string with the new string
Learn Linux sed command