Moderate

The command to count the number of files in the current directory by using pipes, is_______________?

Correct answer: C. ls | wc -w

  • A. ls | wc
  • B. ls -l | wc -l
  • C. ls | wc -w
  • D. ls | ws -c

Explanation

`ls` sends the directory entries to `wc`, and `wc -w` counts them as words. This is the conventional answer, although it may also count directories and can be affected by filenames containing spaces.

Last updated

Practise Software Development Lifecycle

423 free Software Development Lifecycle MCQs from Software Engineering, each with the correct answer and an explanation. Unlimited attempts, no account needed.

Exams that ask Software Engineering questions like this

Software Engineering is on this paper prepared for on TestUstad, and all of them draw the same bank, so this question is worth knowing for it.

Related questions