All mock tests are FREE till 31 December — register to save your progress

Which of the following UNIX/Linux pipes will ⋅c count the number of lines in all the files having h and as their extension in the current working directory?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. cat *.[ch] | wc -l

Explanation

*.[ch] matches files ending in .c or .h; cat joins them and wc -l counts the lines.

More System Software and Operating System questions