Unix – Section 2

21. The command to count the number of files in the current directory by using pipes, is

A. ls | wc
B. ls -l | wc -l
C. ls | wc -w
D. ls | ws -c
E. None of the above

Correct Answer: C. ls | wc -w

22. Which of the following commands is used to get directory one level up?

A. cd
B. cd ..
C. cd/
D. chdir
E. None of the above

Correct Answer: B. cd ..

23. Which of the following commands is used to count the total number of lines, words, and characters contained in a file.

A. count p
B. wc
C. wcount
D. countw
E. None of the above

Correct Answer: B. wc

24. Which command is used to delete all files in the current directory as well as all files and sub-directories in its subdirectories?

A. rm *
B. rm -r *
C. rm all
D. rm *.*
E. None of the above

Correct Answer: B. rm -r *

25. Which of the following commands is used to change the working directory?

A. cd
B. changedir
C. chdir
D. cdir
E. None of the above

Correct Answer: A. cd

Leave A Comment?

one × 3 =