Changes

Jump to: navigation, search

Tutorial9: Regular Expressions

38 bytes added, 11:39, 28 February 2021
INVESTIGATION 3: OTHER COMMANDS THAT USE REGULAR EXPRESSIONS
# View the contents of the '''large-file.txt''' file using the '''more''' command and quickly view the contents of this file.<br><br>
# Issue the following Linux command to view the contents of the '''large-file.txt''':<br><span style="color:blue;font-weight:bold;font-family:courier;">more large-file.txt</span><br><br>
#We want to search for a pattern '''uli101''' within this text file.<br>Type the following regular expression and press ENTER:<br><span style="color:blue;font-weight:bold;font-family:courier;">/uli101</span><br><br>What did you notice?You should see the pattern "uli101" on the second line at the top.<br><br>#Search for the next occurrence of the pattern '''uli101''' by '''re-typing'''<br>the following regular expression and pressing ENTER:<br><span style="color:blue;font-weight:bold;font-family:courier;">/uli101</span><br><br>you should now see the '''second occurrence''' of this pattern within near the text filetop.<br><br>
# Press the letter <span style="color:blue;font-weight:bold;font-family:courier;">q</span> to exit the '''more''' command.<br><br>
# Try the same search techniques with the '''less''' command.<br><br>Does it work the same for the ''less'' command as it did for the ''more'' command?<br><br>
13,420
edits

Navigation menu