User Tools

Site Tools


awk:display_lines_that_contain_a_specific_string

Differences

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

Link to this comparison view

awk:display_lines_that_contain_a_specific_string [2020/09/23 16:09] – created 192.168.1.1awk:display_lines_that_contain_a_specific_string [2021/01/06 17:11] (current) peter
Line 4: Line 4:
 awk '/the_string/' file.txt awk '/the_string/' file.txt
 </code> </code>
 +
 +----
 +
 +====== Example ======
 +
 +Assuming a file, **test.txt**, exists with the following contents:
 +
 +<file>
 +10   Peter     Terence   Roux        45
 +11   Virginia  Genevieve  Roux        45
 +12   Felix     Devon     Roux         5
 +13   David     Bruce     Stevenson   48
 +14   Bob       James     Smith       16
 +48   Adam      Winter    Ridley      23
 +</file>
 +
 +Running
 +
 +<code bash>
 +awk '/Roux/' test.txt
 +</code>
 +
 +returns:
 +
 +<code bash>
 +10   Peter     Terence   Roux        45
 +11   Virginia  Genevieve  Roux       45
 +12   Felix     Devon     Roux         5
 +</code>
 +
  
awk/display_lines_that_contain_a_specific_string.1600877358.txt.gz · Last modified: 2020/09/23 16:09 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki