Quiz Space

System Commands · End Term · 31 Aug 2025 · May 2025 term · Set QDD3

Question 12: Below is the man page of grep. Which of the following co…

Question 12

+5 marksOne or more 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.

Select all that apply.

  1. A

    grep -L "error" *.txt

  2. B

    grep -v "error" *.txt

  3. C

    grep -L "error" -- *.txt

  4. D

    find . -name "*.txt" | xargs grep -L "error"

Show answer

Correct answers

  • A

    grep -L "error" *.txt

  • C

    grep -L "error" -- *.txt

  • D

    find . -name "*.txt" | xargs grep -L "error"

Question 12 of 20 in the IIT Madras BS System Commands (System Commands) End Term paper sat on 31 Aug 2025, in the May 2025 term (IIT M DIPLOMA AN EXAM QDD3 31 Aug 2025). It carries 5 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2Figure question
  3. Q3Figure question
  4. Q4You suspect a configuration file for the package nginx was modified manually. Which command will verify this without re…
  5. Q5A file numbers.txt contains several lines of numeric strings. You want to find lines where any digit is repeated exactl…
  6. Q6You're using gawk to identify repeated words in notes.txt. Which gawk statements correctly use backreferences?
  7. Q7Figure question
  8. Q8Figure question
  9. Q9Figure question
  10. Q10Figure question
  11. Q11Figure question
  12. Q13Which of the following statements about subshells is/are true?
  13. Q14Figure question
  14. Q15Which of the following find commands will list all regular files in /var/log modified more than 7 days ago and larger t…
  15. Q16Figure question
  16. Q17Figure question
  17. Q18Figure question
  18. Q19Figure question
  19. Q20Figure question