Tuesday, January 25, 2011

Remove distinct line with sed

sed '4d;7d' file.txt


This will remove lines 4 and 7 from file.txt

sed '4,7d' file.txt


But this is a range, so will remove lines from 4 to 7 from file.txt

No comments:

Post a Comment