Period (.) = Match any single character
**Caret (^) **= Match the begining of the line
Dollar ($) = Match the end of the line
**[…] **= Match a choice of characters eg. [abcABC]
Asterisk(*) = Matching zero or more characters
{min,max} = Matching Precise number of characters: {…}

Saving Matched Characters :

^\(.\)\1 : Matches first character on the line , and stores into register 1.

**Cut Tutorials : **

cut -cchars file

eg.
cut -c5- data : extracts characters 5 through the end of file.
cut -c1-8 : extracts character 1 through 8
cut -c1-8,18- : extract 1 to 8 and 18 to end.

cut -ddchar -ffields filename
eg.
cut -d: -f1,6 /etc/passwd : extracts fields 1 and 6

If the fields are tab separated: (tab is a default delimiter,so you dont have to specify)
cut -f1 filename

To check if fields are tab delimited:
sed -n 1 filename

Paste:
paste command groups fields from different files:

eg. paste /etc/passwd /etc/shadow

paste -d’+’ file1 file2 file3 [combines fields from three files with + as separator ]

paste -s filename [ paste all lines from names ]

eg. ls | paste -d’ ‘ -s – [ paste ls’s output use space as delimiter]

TR:
syntax: tr from-char to-char

tr a b ‘ ‘ ‘ ‘ : translate all tabs to spaces
tr -s ‘ ‘ ‘ ‘ : traslate all multiple spaces to single space
tr -d ‘\14’ : delete all formfeed characters
tr -d ‘[0-9]’ Delete all digits.

SORT:

syntax : sort

sort -u : eliminate duplicate lines
sort -r : reverse the order of sort
sort -o : specify output file
sort -n : consider first filed on line to be a number and data to be sorted arithmetically useful for multiline file.
sort -t : any character followed by -t is considered to be the delimiter character.

eg.
sort +1n filename : sip first field.
sort +2n -t: /etc/passwd : sort by user id

UNIQ:
Syntax: uniq

uniq -d : List duplicates
uniq -c : count occurrence

eg. uniq filename