Differences

This shows you the differences between two versions of the page.


awk [2016/02/17 17:26] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== awk ======
  
 +  * [[ack]]
 +  * [[grep]]
 +  * [[sed]]
 +
 +=== Tips and Tricks ===
 +
 +== Use awk to print a specific column ==
 +
 +<code>
 +chkconfig --list |grep "3:on" |awk '{print $1}'
 +</code>
 +
 +== Print the last column ==
 +
 +<code>
 +awk '{ print $NF }'
 +</code>
 +
 +== Print a total of a column of numbers in a file ==
 +
 +<code>
 +awk '{ sum += $1 } END { print sum }' filename
 +</code>

Navigation
QR Code
QR Code awk (generated for current page)