A file named values.txt contains seven lines with no surrounding spaces:
4 27 105 id=38 62 74 00 done
Using the C locale, determine the selected-line counts printed by grep -Ec '[0-9]{2}' values.txt and grep -Exc '[0-9]{2}' values.txt. Enter each count in lines as an exact integer, with 0 decimal places.
Unlock full course notes by signing up
Count lines rather than occurrences
The file alerts.txt contains the following six lines, shown in order:
A student runs the case-sensitive command grep -Ec 'err(or)?' alerts.txt. What number does it print? Give the number of selected lines as an exact integer, with 0 decimal places.
Count export files selected by wildcards
A data-export directory contains exactly these eight regular files:
lab1.csv
lab2.csv
Choose equivalent precise patterns
A file names.txt contains one filename per line. You need a case-sensitive command that accepts exactly the prefix report_, followed by one or more digits, followed by the literal suffix .txt, with no extra characters. Assume the C locale. Which commands satisfy this requirement for every possible input line? Select all that apply.
Trace filename expansion before content matching
An audit directory contains exactly the seven regular files below. Each file contains exactly the two lines shown, with no leading or trailing spaces.
From this directory, you run:
Use Bash's default filename-matching settings in the C locale. The -E option enables extended regular expressions. The -l option prints each searched filename once if that file contains at least one matching line; it does not print matching lines. Assume all files are readable.