Unix Utilities

Regular Expressions

. match any character
^ match the beginning of the line
$ match the end of the line
[abc] match a character from list
[^abc] match a charater not in list
* match zero or more of preceding pattern
{n,m} match from n to m of preceding pattern
\(...\) save matched characters

cut

-ccut characters
-fcut fields
-ddelimiter (used with -f)

paste

-d delimeter

sed

s substitute
-n no print
p print lines
d delete lines

tr

-s squeeze (remove duplicate delimiters)
-d delete characters

grep

-i case insensitive. Match both upper and lower case letters.
-v print lines that don't match
-l list file names
-n show line numbers

sort

-u no dups
-r reverse order
-o write to file
-n sort numerically
+1 skip field 1
-t delimeter

uniq

-dshow only duplicate lines
-cshow count of each line