- Farooq Mohammed Ahmed
- Red Hat Enterprise Linux / CentOS
- Hits: 29
SED is a very powerful utility which allows find and replace/insert text functionality. It should be used with Caution and is recommended to use dry-run before committing the changes. Below are the various commands for text manipulation.
\n = for newline and
\t = for TAB space and For dry run just remove "
-i" from the command
Find the pattern and Insert text AFTER
# sed -i 's/.*search 1st Line.*/&\nInsert 2nd line/' file1Add a comment