sed
, awk
, grep
, and perl
have been the traditionally used tools for matching and manipulating lines and strings in Linux. But the bash
shell [1,2] also embodies powerful pattern-matching and substitution capabilities [3–6], many of which are relatively unknown and unused. This blog gives practical examples for using these powerful, but somewhat understated features, to achieve common tasks efficiently and tersely, directly from within bash
itself.