Difference between revisions of "AWK Command"

From rbachwiki
Jump to navigation Jump to search
(Created page with "== Print file == awk '{print}' filename.txt")
 
Line 1: Line 1:
== Print file ==
== Print file ==
  awk '{print}' filename.txt
  awk '{print}' filename.txt
''' Find text in file '''
awk '/bug/ {print}' filename.txt
'''Print certain columns '''
awk '{print $1,$2}' filename.txt

Revision as of 16:03, 17 August 2021

Print file

awk '{print}' filename.txt

Find text in file

awk '/bug/ {print}' filename.txt

Print certain columns

awk '{print $1,$2}' filename.txt