

MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Unix knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which one of the following option is used for checking that the string is not null? |
A. | -a |
B. | -o |
C. | -z |
D. | -n |
Answer» E. | |
2. |
Which one of the following option is used for OR operation in test command? |
A. | -o |
B. | -a |
C. | -e |
D. | -an |
Answer» B. -a | |
3. |
Which one of the following option is used for AND operation in test command? |
A. | -o |
B. | -a |
C. | -e |
D. | -an |
Answer» C. -e | |
4. |
test and [ ] can be used for string comparison. |
A. | True |
B. | False |
Answer» B. False | |
5. |
It is essential to use whitespaces when we use []. |
A. | True |
B. | False |
Answer» B. False | |
6. |
Which of the following operator is used as a shorthand for test? |
A. | % % |
B. | [ ] |
C. | & & |
D. | ( ) |
Answer» C. & & | |
7. |
___ implies greater than and ____ implies less than. |
A. | gt, le |
B. | gt, lt |
C. | ge,le |
D. | ge,lt |
Answer» C. ge,le | |
8. |
We can use comparison operators without a ‘-‘. |
A. | True |
B. | False |
Answer» C. | |
9. |
Which of the following operators is used with test for comparison of numeric values? |
A. | -eq |
B. | -ne |
C. | -gg |
D. | –eq and -ne |
Answer» E. | |
10. |
test command can be used to check which of the following? |
A. | Compare two numbers |
B. | Compare two strings |
C. | Check attributes of a file |
D. | All of the mentioned |
Answer» E. | |