Re:Mastering Bash and Terminal
by u801e on Sunday January 15, 2017 @01:42PM
(#13405557)
It's interesting to read up on the relationship between ed, sed, ex, and vi. In fact, all 4 of those editors have similar ways of addressing line ranges (1 for the first line, $ for the last line, etc).
One interesting feature many people may not know about is that it's possible to address lines using a regular expression.
For instance, if you had the following text in a vim buffer:
one
two
three
four
five
and you wanted to delete the lines between "two" and "four" inclusive, you could run the following command in vim:
One interesting feature many people may not know about is that it's possible to address lines using a regular expression.
For instance, if you had the following text in a vim buffer:
and you wanted to delete the lines between "two" and "four" inclusive, you could run the following command in vim: You could also do the same thing in sed