Awk

Awk is text-processing utility.

awk '/tom|jerry|vivek/' /etc/passwd

Specify : as seperator

awk -F: '{print $1}' /etc/passwd

use of printf

awk '{printf "%s ",$2}' file

Command line on bash

awk '
  BEGIN { actions } 
  /pattern/ { actions }
  /pattern/ { actions }
      ……….
   END { actions } 
' filenames

Execute a awk script
awk -f mypgoram.awk input.txt

#### Process and print
echo 4000000 | awk '{print $1*10^-6 " Wh"}'