1.display lines between 20 and 30 of file x1

=> sed -n -e '20,30p' x1


2.to display first 6 lines from file x1

=> sed -n -e ‘1,6p’ filename

 3. Replace all occurrences of 'SYBCA' with 'TYBCA' in 5th line of file f1.txt.

=> sed -i ‘s/sybca/tybca/g’ f1.txt | sed -n ‘5p’


Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post