13,420
edits
Changes
→INVESTIGATION 1: USING THE SED UTILITY
# Issue the following linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">sed '11 q' data.txt</span><br><br>What did you notice?<br><br>You can use regular expressions to select lines that match a pattern. The rules remain the same for using regular expressions as demonstrated in lab8 except the regular expression must be contained within delimiters such as the forward slash "/" when using the sed utility.<br><br>
# Issue the following linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">sed -n '/^The/ p' data.txt</span><br><br>What do you notice?<br><br>
# Issue the following linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">sed -n '/d$/ p' data.txt</span><br><br>What do you notice?<br><br>The '''sed''' utility can also be used as a filter to manipulate text that was generated from linux commands.<br><br># xIssue the following linux pipeline command:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls | sed -n '/txt$/ p'</span><br><br>What did you notice?<br><br># Issue the following linux pipeline command:<br><span style="color:blue;font-weight:bold;font-family:courier;">who | sed -n '/^[a-m]/ p' | more</span><br><br>What did you notice?<br><br>
In the next investigation, you will ..learn how to manipulate text using the awk utility.<br><br>
=INVESTIGATION 2: USING THE AWK UTILITY =