4.4 Unix-like text processing
There are few standard text processing tools which are used very often on the
Unix-like system.
-
No regular expression is used:
-
head
outputs the first part of files.
-
tail
outputs the last part of files.
-
sort
sorts lines of text files.
-
uniq
removes duplicate lines from a sorted file.
-
tr
translates or deletes characters.
-
diff
compares files line by line.
-
Basic regular expression (BRE) is used:
-
grep
matches text with the pattern.
-
ed
is a primitive line editor.
-
sed
is a stream editor.
-
vi
is a screen editor.
-
emacs
is a screen editor.
-
Extended regular expression (ERE) is used:
See
Regular-expression substitution, Section
8.6.13,
Script snippets for piping
commands, Section 8.6.18, and
Perl
short script madness, Section 8.6.20 for some script examples.