Explore topic-wise MCQs in Unix.

This section includes 12 Mcqs, each offering curated multiple-choice questions to sharpen your Unix knowledge and support exam preparation. Choose a topic below to get started.

1.

______ option is used for compressing multiple consecutive characters.

A. -d
B. -c
C. -n
D. -s
Answer» E.
2.

Which option is used with tr command for deleting characters?

A. -d
B. -c
C. -n
D. -a
Answer» B. -c
3.

To replace | with ~, which one of the following commands will be used?a) tr ‘|\’ ‘~-‘b) tr ‘|\’ ‘~-‘ > emp.lstc) tr | ~ emp.lstd) ! Above command will change the case of text from lower to upper.

A. tr ‘|\’ ‘~-‘b) tr ‘|\’ ‘~-‘ > emp.lstc) tr | ~ emp.lstd) ! Above command will change the case of text from lower to upper.a) True
B. tr ‘|\’ ‘~-‘ > emp.lst
C. tr | ~ emp.lst
D. ! Above command will change the case of text from lower to upper.a) Trueb) FalseView Answer
Answer» C. tr | ~ emp.lst
4.

The output of the following command will be:

A. erroneous
B. output stored in foo2
C. concatenates both files
D. process foo1 and output is stored in foo2View Answer
Answer» E.
5.

TO_REPLACE_|_WITH_~,_WHICH_ONE_OF_THE_FOLLOWING_COMMANDS_WILL_BE_USED??$

A. tr ‘|\’ ‘~-‘
B. tr ‘|\’ ‘~-‘ > emp.lst
C. tr | ~ emp.lst
D. !
Answer» B. tr ‚Äö√Ñ√∂‚àö√ë‚àö‚â§|\‚Äö√Ñ√∂‚àö√ë‚àö¬• ‚Äö√Ñ√∂‚àö√ë‚àö‚â§~-‚Äö√Ñ√∂‚àö√ë‚àö‚â§ > emp.lst
6.

Which command is used for translating characters?

A. sort
B. trans
C. tr
D. paste
Answer» C. tr
7.

erroneous

A. output stored in foo2
B. concatenates both files
C. process foo1 and output is stored in foo2
Answer» D.
8.

______ option is used for counting frequency of occurrence.

A. -d
B. -c
C. -u
D. -a
Answer» C. -u
9.

Which option is used for selecting repeated entries?

A. -d
B. -c
C. -u
D. -a
Answer» B. -c
10.

Which option is used with uniq command for selecting non-repeated lines?

A. -i
B. -c
C. -u
D. -a
Answer» D. -a
11.

uniq command requires a sorted file as input.

A. True
B. False
Answer» B. False
12.

Which command is used for locating repeated and non-repeated lines?

A. sort
B. uniq
C. cut
D. paste
Answer» C. cut