13,420
edits
Changes
→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 "^[-+]" ~murray.saul/uli101/numbers.txt</span> <br>2. <span style="font-family:courier;font-weight:bold">grep "^[-+]*.[0-9]" ~murray.saul/uli101/numbers.txt</span> <br>3. <span style="font-family:courier;font-weight:bold">grep "^[+-]?[0-9]" ~murray.saul/uli101/numbers.txt</span><br> (Why?) <br>4. <span style="font-family:courier;font-weight:bold">egrep "^[+-]?[0-9]" ~murray.saul/uli101/numbers.txt</span> <br>5. <span style="font-family:courier;font-weight:bold">egrep "^[+-]?[0-9]+$" ~murray.saul/uli101/numbers.txt</span> <br>6. <span style="font-family:courier;font-weight:bold">egrep "^[+-]?[0-9]+[.]?[0-9]+$" <br> ~murray.saul/uli101/numbers.txt</span>