Changes

Jump to: navigation, search

Tutorial11: Sed & Awk Utilities

751 bytes added, 08:13, 19 July 2020
LINUX PRACTICE QUESTIONS
'''Part C: Writing Linux Commands Using the awk Utility'''
 
Note the contents from the following tab-delimited file called '''~murray.saul/uli101/stuff.txt''':
(this file pathname exists for checking your work)
 
<pre>
Line one.
This is the second line.
This is the third.
This is line four.
Five.
Line six follows
Followed by 7
Now line 8
and line nine
Finally, line 10
</pre>
 
 
'''Write the results of each of the following Linux commands for the above-mentioned file:'''
 
 
# awk ‘NR == 3 {print}’ ~murray.saul/uli101/stuff.txt<br><br>
# awk ‘NR >= 2 && NR <= 5 {print}’ ~murray.saul/uli101/stuff.txt
# awk ‘$1 ~ /This/ {print $2}’ ~murray.saul/uli101/stuff.txt
# awk ‘$1 ~ /This/ {print $3,$2}’ ~murray.saul/uli101/stuff.txt
 
 
 
 
13,420
edits

Navigation menu