Shell Interview Questions and Answers

 

Given a file, replace all occurrence of word "ABC" with "DEF" from 5th line till end in only those lines that contains word "MNO"

sed -n `5,$p` file1|sed `/MNO/s/ABC/DEF/`

Posted by:Richards