Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
System Commands
Regular expressions & grep
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
Quiz 1 · 26 Oct 2025 (AN)Quiz 1
- Q1MCQ3 Marks·Choose one option

- ALines starting with 3 letters and containing 2 digits anywhere.
- BLines containing exactly 3 letters followed by exactly 2 digits.
- CLines ending with 2 digits.
- DAny line containing at least 3 letters and 2 digits.
- Q2MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q3MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q4NAT4 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (FN)End Term
- Q5MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q6NAT5 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (AN)End Term
- Q7MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q8MCQ5 Marks·Choose one option
A file numbers.txt contains several lines of numeric strings. You want to find lines where any digit is repeated exactly twice consecutively (like "1123", "4456"). Which command works correctly?
- A

- B

- C

- D

- A
- Q9MSQ5 Marks·Choose all correct options
Below is the man page of `grep`.
Which of the following commands will print only the name of all .txt files that do not contain the word "error"? Assume the current directory does not have any subdirectories. Assume the filenames are alphanumeric.- Agrep -L "error" *.txt
- Bgrep -v "error" *.txt
- Cgrep -L "error" -- *.txt
- Dfind . -name "*.txt" | xargs grep -L "error"
End Term · 13 Apr 2025 (FN)End Term
- Q10MCQ6 Marks·Choose one option

- A

- B

- C

- D

- A
End Term · 22 Dec 2024 (FN)End Term
- Q11MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q12MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q13MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- A
End Term · 22 Dec 2024 (AN)End Term
- Q14MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q15MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q16MSQ4 Marks·Choose all correct options

- A12321
- B12345
- CA1B1A
- D9zXz9
- EA1BA1
- FARIRA