Unix Tricks
2013-12-24
Here are a few Unix command line tricks that I've learned recently.
... | vim -
Edit search results by piping text into vim -
instead of less
.
tr -s ' '
Squeeze consecutive spaces into a single space. Also works for other characters.
grep -B/-A
Display lines before (-B
) and after (-A
) a matching line.
I find these flags confusing, since they could be "Above" and "Below".