Changes

Jump to: navigation, search

Tutorial9: Regular Expressions

No change in size, 10:16, 9 March 2021
INVESTIGATION 3: OTHER COMMANDS USING REGULAR EXPRESSIONS
# Issue the following Linux command to download another data file called '''large-file.txt''':<br><span style="color:blue;font-weight:bold;font-family:courier;">wget <nowiki>https://ict.senecacollege.ca/~murray.saul/uli101/large-file.txt</nowiki></span><br><br>
# View the contents of the '''large-file.txt''' file using the '''more''' command and quickly view the contents of this file.<br><br>[[Image:other-re-2.png|thumb|right|300px|Entering '''/uli101''' in the '''more''' and '''less''' commands can search for the string "'''uli101'''".]]
# 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 less 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>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 near the top.<br><br>
13,420
edits

Navigation menu