Changes

Jump to: navigation, search

Tutorial9: Regular Expressions

51 bytes added, 11:21, 11 November 2020
LINUX PRACTICE QUESTIONS
Write the results of each of the following Linux commands using regular expressions for the above-mentioned file.
1. <span style="font-family:courier;font-weight:bold">grep plym ~murray.saul/uli101/cars</span><br>2. <span style="font-family:courier;font-weight:bold">grep -i fury ~murray.saul/uli101/cars</span><br>3. <span style="font-family:courier;font-weight:bold">grep “^[m-z]” ~murray.saul/uli101/cars</span><br>
4. <span style="font-family:courier;font-weight:bold">grep -i “^[m-z]” ~murray.saul/uli101/cars</span>
5. <span style="font-family:courier;font-weight:bold">grep “3$” ~murray.saul/uli101/cars</span><br>6. <span style="font-family:courier;font-weight:bold">grep -i “c.*5$” ~murray.saul/uli101/cars</span><br>
7. Write a Linux command to display all lines in the file called '''~/text.txt''' that contains the pattern:
the<br>
8. Write a Linux command to display all lines in the file called '''~/text.txt''' that contains the word:
the<br>9. Write a Linux command to display all lines in the file called '''~/text.txt''' that begin with a number.<br>10. Write a Linux command to display all lines in the file called '''~/text.txt''' that end with a letter (either upper or lowercase).<br>11. Write a Linux command to display all lines in the file called '''~/text.txt''' that begin and end with a number.<br>12. Write a Linux command to display all lines in the file called '''~/text.txt''' that contains exactly 3 characters that can be anything.<br>13. Write a Linux command to display all lines in the file called '''~/text.txt''' that contains exactly 3 numbers.<br>14. Write a Linux command to display all lines in the file called '''~/text.txt''' that contains 1 or more “C” characters.<br>
<br><br>
13,420
edits

Navigation menu