Changes

Jump to: navigation, search

Tutorial11: Sed & Awk Utilities

511 bytes added, 08:02, 24 July 2020
INVESTIGATION 1: USING THE SED UTILITY
# 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/data.txt</nowiki></span><br><br>
# Issue the '''more''' command to quickly view the contents of the '''data.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>
# Issue the following linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">sed 'p' data.txt</span><br><br>You should notice that each line appears twice. The reason why standard output appears twice is that the sed command (without the -n option) displays all lines regardless if they had been specified as a pattern.# Issue the following linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">sed -n 'p' data.txt</span><br><br>What do you notice?<br><br>x
In the next investigation, you will ...<br><br>
13,420
edits

Navigation menu