Thursday, April 9, 2009

Linux:shell:BASH: How to delete one line by sed

If you want to delete one line containing one word "ThisWord" by sed, then you can do in the way:

sed -i "/ThisWord/d" YourTextFile.txt

Note, here '-i' is to delete it from the original file. Without it, sed only prints the file on screen. So before using '-i', make sure you are doing correct things.

No comments:

Locations of visitors to this page