linux_wiki:awk

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:awk [2016/03/28 22:15]
billdozor [Awk]
linux_wiki:awk [2019/05/25 23:50] (current)
Line 6: Line 6:
 Gawk is the GNU Project's implementation of the AWK programming language. Gawk is the GNU Project's implementation of the AWK programming language.
  
-I typically stick to using gawk and in most cases, awk is a symlink to gawk+In most cases, awk is a symlink to gawk.
-This page will contain useful gawk commands as I run into them.+
  
 **Checklist** **Checklist**
   * Distro(s): Any   * Distro(s): Any
-  * gawk installed+  * Software: awk/gawk installed
  
 ---- ----
Line 49: Line 48:
 true true
 </code> </code>
 +
 +----
 +
 +===== Print Line After Match =====
 +
 +Search for a regex string and print the line AFTER the match.
 +
 +<code bash>
 +awk '/mystring/ { getline; print }'
 +</code>
 +  * mystring => regex string to search for
 +  * getline => set the line $0 to the next line
 +  * print => print the line
  
 ---- ----
  • linux_wiki/awk.1459217743.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)