I didn't understand it well, so I summarized it briefly.
"Sed" is an abbreviation for "Stream EDitor"
sed -Optional script command input file
With the above command Processes the specified file according to the command and outputs it to the standard output.
option | Right align |
---|---|
-r | In script(Not a basic regular expression)Use extended regular expressions |
-f script file | Add the contents of the script file as a command to execute |
-escript | Add script |
-i | Replace the original file with the output instead of outputting to standard output |
Change "abc" in the file to "ABC"
sed s/adc/ABC file name
The first argument is treated as a sed script and all remaining arguments are treated as input files.
In / etc / shells, replace the place where "usr" is written with "USER"
sed s/user/USER/ /etc/shells
#script#file name
It was easy, but like this, Now that I understand what it is like, I would like to make it usable.
Recommended Posts