MCQOPTIONS
Saved Bookmarks
This section includes 358 Mcqs, each offering curated multiple-choice questions to sharpen your Unix knowledge and support exam preparation. Choose a topic below to get started.
| 101. |
expr can perform ____ arithmetic operations. |
| A. | 2 |
| B. | 4 |
| C. | 5 |
| D. | 3 |
| Answer» D. 3 | |
| 102. |
Which symbol is used for finding the length of the string? |
| A. | . |
| B. | * |
| C. | .* |
| D. | .*. |
| Answer» D. .*. | |
| 103. |
Every pattern in case statement in terminated with a ____ |
| A. | ; |
| B. | : |
| C. | ;; |
| D. | // |
| Answer» D. // | |
| 104. |
____ option is used for checking whether a particular file is older than a specified file. |
| A. | -ef |
| B. | -old |
| C. | -nt |
| D. | -ot |
| Answer» E. | |
| 105. |
To check if the file exists and is executable we have to use ___ option with test. |
| A. | -e |
| B. | -f |
| C. | -x |
| D. | -w |
| Answer» D. -w | |
| 106. |
Which option is used for checking if the file exists or not? |
| A. | -e |
| B. | -a |
| C. | -f |
| D. | -n |
| Answer» B. -a | |
| 107. |
Which of the following option is used for checking if the file is readable or not? |
| A. | -e |
| B. | -f |
| C. | -n |
| D. | -z |
| Answer» B. -f | |
| 108. |
Which of the following option is used for checking if the file is writable or not? |
| A. | -e |
| B. | -f |
| C. | -n |
| D. | -w |
| Answer» E. | |
| 109. |
Which one of the following option is used for checking that the string is NULL string? |
| A. | -a |
| B. | -o |
| C. | -z |
| D. | -n |
| Answer» D. -n | |
| 110. |
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. | |
| 111. |
Which one of the following option is used for AND operation? |
| A. | -o |
| B. | -a |
| C. | -e |
| D. | -an |
| Answer» C. -e | |
| 112. |
The syntax for using && is ____________ |
| A. | cmd1 && cmd2 |
| B. | cmd1 cmd2 && |
| C. | cmd1 & cmd2& |
| D. | cmd1 |
| Answer» B. cmd1 cmd2 && | |
| 113. |
To check more than two conditions, ___ is used with if-else statements . |
| A. | while |
| B. | for |
| C. | elif |
| D. | for |
| Answer» D. for | |
| 114. |
test works in ____ ways. |
| A. | 3 |
| B. | 2 |
| C. | 4 |
| D. | 1 |
| Answer» B. 2 | |
| 115. |
To know the exit status of a command, we can use __ |
| A. | $$ |
| B. | $* |
| C. | $? |
| D. | $- |
| Answer» D. $- | |
| 116. |
Which of the following is not a special parameter used by the shell? |
| A. | $$ |
| B. | $* |
| C. | $? |
| D. | $- |
| Answer» E. | |
| 117. |
Every if is closed with a corresponding ___ |
| A. | else |
| B. | fi |
| C. | if |
| D. | else if |
| Answer» C. if | |
| 118. |
To perform decision depending on the fulfilment of certain criteria, ____ is used. |
| A. | if |
| B. | else |
| C. | for |
| D. | if and else |
| Answer» E. | |
| 119. |
The syntax for using && is __________ |
| A. | cmd1 && cmd2 |
| B. | cmd1 cmd2 && |
| C. | cmd1 & cmd2& |
| D. | cmd1 |
| Answer» B. cmd1 cmd2 && | |
| 120. |
The statement used to find out which character sets are available is ___ |
| A. | SHOW CHARACTER SET |
| B. | SHOW COLLATION |
| C. | SHOW CHARACTER SETS |
| D. | SHOW COLLATIONS |
| Answer» B. SHOW COLLATION | |
| 121. |
The variable used to set table alias names as non case sensitive is _____ |
| A. | lower_case_table_names |
| B. | lower_case_all |
| C. | lower_case_alias |
| D. | lower_case_aliases |
| Answer» B. lower_case_all | |
| 122. |
The clause that can be used to sort string values according to a specific collation is __________ |
| A. | SORT |
| B. | GROUP |
| C. | FILTER |
| D. | COLLATE |
| Answer» E. | |
| 123. |
The case sensitive among these is ______ |
| A. | Stored function name |
| B. | Stored procedure name |
| C. | Trigger name |
| D. | Event name |
| Answer» D. Event name | |
| 124. |
Anonymous accounts have user name _____ |
| A. | root |
| B. | blank |
| C. | super |
| D. | prime |
| Answer» C. super | |
| 125. |
The superuser account of the grant tables in the mysql database is called __________ |
| A. | super |
| B. | prime |
| C. | root |
| D. | leaf |
| Answer» D. leaf | |
| 126. |
Which command will be used for selecting lines 3 to 10 from emp.lst? |
| A. | sed 3,10 emp.lst |
| B. | sed -n ‘3,10p’ emp.lst |
| C. | sed -n ‘^,10p’ emp.lst |
| D. | sed -n, 10p |
| Answer» C. sed -n ‘^,10p’ emp.lst | |
| 127. |
Which shortcut does sed offer to replace the string Linux with Red hat Linux? |
| A. | { } |
| B. | ( ) |
| C. | ^^ |
| D. | & |
| Answer» E. | |
| 128. |
The interval regular expression uses the character _____ |
| A. | { |
| B. | } |
| C. | { and } |
| D. | ( and ) |
| Answer» D. ( and ) | |
| 129. |
Which one of the following command will be used for adding two spaces before every line in emp.lst? |
| A. | sed ‘s/^/ /’ emp.lst |
| B. | sed ‘s / / /’emp.lst |
| C. | sed ‘s /$/ /’emp.lst |
| D. | sed ‘s/$/ |
| Answer» B. sed ‘s / / /’emp.lst | |
| 130. |
To replace the string ‘director’ in the first five lines of file emp.lst with ‘manager’ we can use _____ |
| A. | sed ‘s/director/manager/’ emp.lst |
| B. | sed ‘1-5s/director/manager/’ emp.lst |
| C. | sed ‘1,5s/director/manager/’ emp.lst |
| D. | sed ‘15s |
| Answer» D. sed ‘15s | |
| 131. |
To write selected lines, ____ is used with sed. |
| A. | i |
| B. | n |
| C. | w |
| D. | p |
| Answer» D. p | |
| 132. |
To select lines containing gupta and agarwal, which command will be used? |
| A. | sed -n ‘/gupta/,/agarwal/p’ emp.lst |
| B. | sed -n ‘/gupta/agarwal/p’ emp.lst |
| C. | sed ‘/gupta | agarwal’p’ emp.lst |
| D. | sed -n |
| Answer» B. sed -n ‘/gupta/agarwal/p’ emp.lst | |
| 133. |
____ option is used for taking instructions from a file. |
| A. | -f |
| B. | -e |
| C. | -i |
| D. | -n |
| Answer» B. -e | |
| 134. |
To perform context addressing, we have to enclose the pattern in ___ |
| A. | double quotes |
| B. | single quotes |
| C. | / / |
| D. | $ $ |
| Answer» D. $ $ | |
| 135. |
Which option is used with sed for using multiple instructions? |
| A. | -f |
| B. | -n |
| C. | -i |
| D. | –f and -e |
| Answer» E. | |
| 136. |
To suppress the behaviour of ‘p’ command, we use ____ option. |
| A. | -p |
| B. | -q |
| C. | -i |
| D. | -v |
| Answer» C. -i | |
| 137. |
Which of the following symbols are used for matching multiple patterns? |
| A. | | |
| B. | & |
| C. | ( and ) |
| D. | | and ( and ) |
| Answer» D. | and ( and ) | |
| 138. |
Which option is used when we want to use an ERE with grep command? |
| A. | -e |
| B. | -i |
| C. | -E |
| D. | -l |
| Answer» D. -l | |
| 139. |
Which of the following symbols are a set of ERE (extended regular expressions) ? |
| A. | + |
| B. | – |
| C. | ? |
| D. | + and – |
| Answer» E. | |
| 140. |
Which of the following symbol is used for matching the immediate preceding character? |
| A. | * |
| B. | $ |
| C. | [ ] |
| D. | % |
| Answer» B. $ | |
| 141. |
Character class is used for matching a group of characters enclosed within a pair of __ |
| A. | ( ) |
| B. | “ “ |
| C. | [ ] |
| D. | { } |
| Answer» D. { } | |
| 142. |
Which option displays only the filename containing the pattern? |
| A. | -i |
| B. | -n |
| C. | -e |
| D. | -l |
| Answer» E. | |
| 143. |
Which option is used for displaying the line numbers containing the pattern along with lines? |
| A. | -v |
| B. | -i |
| C. | -e |
| D. | -n |
| Answer» E. | |
| 144. |
______ option counts the number of lines containing the pattern? |
| A. | -c |
| B. | -i |
| C. | -e |
| D. | -n |
| Answer» B. -i | |
| 145. |
If there are special characters in a pattern, then we’ve to enclose them in ____ |
| A. | single quotes |
| B. | double quotes |
| C. | without any quotes |
| D. | all quotes |
| Answer» C. without any quotes | |
| 146. |
Which one of the following command will be used for searching “director” in emp.lst? |
| A. | grep “director” |
| B. | grep -v “director” emp.lst |
| C. | grep -director emp.lst |
| D. | grep “director” emp.lst |
| Answer» E. | |
| 147. |
Which option is used with tr command for deleting characters? |
| A. | -d |
| B. | -c |
| C. | -n |
| D. | -a |
| Answer» B. -c | |
| 148. |
_____ option is used for compressing multiple consecutive characters. |
| A. | -d |
| B. | -c |
| C. | -n |
| D. | -s |
| Answer» E. | |
| 149. |
To replace | with ~, which one of the following commands will be used? |
| A. | tr ‘|\’ ‘~-‘ |
| B. | tr ‘|\’ ‘~-‘ > emp.lst |
| C. | tr | ~ emp.lst |
| D. | ! |
| Answer» C. tr | ~ emp.lst | |
| 150. |
_____ option is used for counting frequency of occurrence. |
| A. | -d |
| B. | -c |
| C. | -u |
| D. | -a |
| Answer» C. -u | |