Changes

Jump to: navigation, search

Tutorial11: Sed & Awk Utilities

88 bytes added, 08:46, 17 March 2021
INVESTIGATION 2: USING THE AWK UTILITY
# Change to your '''home''' directory and issue a command to '''confirm'''<br>you are located in your ''home'' directory.<br><br>
# Issue a Linux command to create a directory called '''awk'''<br><br>
# Issue a Linux command to <u>change</u> to the '''awk''' directory and confirm you are located in the '''awk''' directory.<br><br>Let's download a database file that contains information regarding classic cars.<br><br>
# Issue the following linux command ('''copy and paste''' to save time):<br><span style="color:blue;font-weight:bold;font-family:courier;">wget <nowiki>https://ict.senecacollege.ca/~murray.saul/uli101/cars.txt</nowiki></span><br><br>
# Issue the '''more''' command to quickly view the contents of the '''cars.txt''' file.<br>When finished, exit the more command by pressing the letter <span style="color:blue;font-weight:bold;font-family:courier;">q</span><br><br>The "'''print'''" action (command) is the <u>default</u> action of awk<br>to print all selected lines that match a '''pattern'''.<br>This '''action''' (contained in braces) can provide more options<br>such as printing specific fields of selected lines (or records) from a database.<br><br>[[Image:awk-1.png|thumb|right|400px|Using the awk command to display matches of the pattern '''ford'''.]]
13,420
edits

Navigation menu