MCQOPTIONS
Saved Bookmarks
This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
The statement z=’expr 5/2’ would store in z a value |
| A. | 2.5 |
| B. | 3 |
| C. | 2 |
| Answer» D. | |
| 2. |
The difference between the commands ps –e and ps –a is |
| A. | ps –e gives details of every process running in memory whereas ps –a gives output for all the process that you have launched |
| B. | ps –e gives details of every process running in memory whereas ps –a gives details of all user processes |
| C. | no difference , both give same output |
| D. | none of the above |
| Answer» C. no difference , both give same output | |
| 3. |
The output of command banner “Unix shell programming” would be |
| A. | a banner showing ‘unix’,’shell’ and ‘programming’ words displayed in separate lines |
| B. | a banner showing ‘unix shell’ in one single line |
| C. | nothing |
| D. | a banner showing ‘unix shell programming’ in one line. |
| Answer» C. nothing | |
| 4. |
Which of the following options will be used to display number of blocks used by a file? |
| A. | -c |
| B. | -i |
| C. | -d |
| D. | -s |
| Answer» E. | |
| 5. |
Which of the following commands is used to identify the type of file by context? |
| A. | ls |
| B. | cat |
| C. | file |
| D. | more |
| Answer» D. more | |
| 6. |
Which command will be used with vi editor to insert text to left of cursor? |
| A. | s |
| B. | s |
| C. | a |
| D. | i |
| Answer» E. | |
| 7. |
Which of the following keys is used to replace a dingle character with new text |
| A. | s |
| B. | s |
| C. | r |
| D. | c |
| Answer» C. r | |
| 8. |
Which command is used to extract a specific columns from the file |
| A. | cat |
| B. | cut |
| C. | grep |
| D. | paste |
| Answer» C. grep | |
| 9. |
Which command is used to remove a directory |
| A. | rd |
| B. | rmdir |
| C. | dldir |
| D. | rdir |
| Answer» C. dldir | |
| 10. |
The command is used to compare the files is known as |
| A. | comp |
| B. | cmp |
| C. | do |
| D. | ccp |
| Answer» C. do | |
| 11. |
Which option will be used with sort command to start sorting after the nth column of the (m+1)th field |
| A. | –m.n |
| B. | +m.n |
| C. | +n.m+1 |
| D. | +(m+1).n |
| Answer» C. +n.m+1 | |
| 12. |
Which command is used to terminate a process |
| A. | shutdown |
| B. | haltsys |
| C. | cancel |
| D. | kill |
| Answer» E. | |
| 13. |
An until loop ensures that the statement within the loop get executed |
| A. | only once |
| B. | atleast once |
| C. | not even once |
| D. | none of the above |
| Answer» E. | |
| 14. |
The break statement is used to exit from |
| A. | an if statement |
| B. | a for loop |
| C. | a program |
| D. | none of the above |
| Answer» C. a program | |
| 15. |
Hierarchy decides which operator |
| A. | is most important |
| B. | is used first |
| C. | is fastest |
| D. | operates on largest numbers |
| Answer» C. is fastest | |
| 16. |
The expression expr -2 % 7 evaluates to |
| A. | 2 |
| B. | -2 |
| C. | 0.285 |
| Answer» C. 0.285 | |
| 17. |
The expression expr -7 % 2evaluates to |
| A. | 1 |
| B. | -1 |
| C. | -3.5 |
| Answer» C. -3.5 | |
| 18. |
The statement z=’expr 5/2’ would store in z a value |
| A. | 2.5 |
| B. | 3 |
| C. | 2 |
| Answer» D. | |
| 19. |
Which of the following is allowed in an arithmetic statement involving exprinstruction |
| A. | [] |
| B. | {} |
| C. | () |
| D. | none of the above |
| Answer» D. none of the above | |
| 20. |
Which of the following shows the correct hierarchy of arithmetic operations in shell |
| A. | (),**,* or /, + or – |
| B. | (), **, *,/,+,- |
| C. | (),**,/,*,+,- |
| D. | (),/,% or *,- or + |
| Answer» E. | |
| 21. |
On executing the command Shift $v |
| A. | the positional parameters would be shifted by the value of the variable v |
| B. | the positional parameters would be shifted by 1 |
| C. | the positional parameters would not be shifted at all |
| D. | this command would result into an error |
| Answer» B. the positional parameters would be shifted by 1 | |
| 22. |
On executing a statement set -3+1 |
| A. | $1 would be -3 |
| B. | $1 would be – |
| C. | $1 would be set |
| D. | this command would result into an error |
| Answer» E. | |
| 23. |
When we are executing a shell script the shell acts as |
| A. | an interpreter |
| B. | a compiler |
| C. | an operating system |
| D. | none of the above |
| Answer» B. a compiler | |
| 24. |
The shell metacharacter $# represents |
| A. | total number of arguments supplied to the shell script |
| B. | total number of files in the current directory |
| C. | total number of users who have logged in |
| D. | total number of processes running in the background |
| Answer» B. total number of files in the current directory | |
| 25. |
A null variable a can be created using |
| A. | a= |
| B. | a=’’ |
| C. | a=â€â€ |
| D. | all the above |
| Answer» E. | |
| 26. |
Which of the following assignment is illegal |
| A. | a=’cat file’ |
| B. | a=100 b=50 |
| C. | age=25 |
| D. | all the above |
| Answer» D. all the above | |
| 27. |
Which of the following assignments is illegal |
| A. | a=’ls’ |
| B. | b=’ls –l’ |
| C. | c=’1972’ |
| D. | d=’who | grepaal’ |
| Answer» D. d=’who | grepaal’ | |
| 28. |
The escape sequence \033[4m is used to |
| A. | underlying characters |
| B. | mark them as bold |
| C. | display them in reverse video |
| D. | none of the above |
| Answer» C. display them in reverse video | |
| 29. |
.mailrc is the file |
| A. | which stores the incoming mail |
| B. | which is used to type the mail to be sent |
| C. | which is invoked when the mail command is executed |
| D. | which permits you to customize the vi environment |
| Answer» D. which permits you to customize the vi environment | |
| 30. |
The incoming mail of user with the login name aa12 is stored in the file |
| A. | /usr/spool/mail/aa12 |
| B. | /usr/aa12/mbox |
| C. | /spool/mail/aa12 |
| D. | /usr/aa12/.mbox |
| Answer» B. /usr/aa12/mbox | |
| 31. |
The message of the day is stored in a file called |
| A. | /etc/profile |
| B. | /etc/motv |
| C. | .profile |
| D. | autoexec.bat |
| Answer» C. .profile | |
| 32. |
To read the stale news the option available is |
| A. | news –a |
| B. | delete the file /usr/news |
| C. | delete the file _news.time |
| D. | delete the file .news_time |
| Answer» B. delete the file /usr/news | |
| 33. |
The command that unix offers to a user to find out whether he can send messages to a particular terminal are |
| A. | finger and who |
| B. | finger –mesg and who –t |
| C. | finger –i and who –t |
| D. | finger –i and who –t |
| Answer» E. | |
| 34. |
If the user has read a news item he cannot read it again because of creation of the file |
| A. | _news_time |
| B. | news.time |
| C. | .news.time |
| D. | .news_time |
| Answer» E. | |
| 35. |
For a person to receive messages he should have his terminal set to a parameter which will allow him receive messages.The command to set this parameter is |
| A. | message –on |
| B. | msg –o |
| C. | mesg –y |
| D. | message–y |
| Answer» D. message–y | |
| 36. |
Which of the following is not true |
| A. | the at command permits you to receive messages only by mail |
| B. | a person’s login name appears in the file at.allow if he is not allowed to use the at command |
| C. | both are false |
| D. | both are true |
| Answer» D. both are true | |
| 37. |
Which of the following is not true regards the kill command |
| A. | super user can kill deamon processes |
| B. | for sure kill the signal no is 9 |
| C. | there is no surety that the shell process will get killed by the command kill |
| D. | using kill command you can kill other user’s processes too |
| Answer» B. for sure kill the signal no is 9 | |
| 38. |
Which of the following is not true regarding the command $ nohup cat *.let | nohup sort >f1 & |
| A. | the process would die if the user logs out before the command’s execution is over |
| B. | if the user logs out the output of sort would be dtored in a file nohup.out |
| C. | it is optional to give nohup before sort |
| D. | this background process is also known as a deamon process |
| Answer» B. if the user logs out the output of sort would be dtored in a file nohup.out | |
| 39. |
The process id numbers of the processes vhand,bdflush,sched and init are |
| A. | 1,2,3 and 4 |
| B. | 2,3,0 and 1 |
| C. | 3,4,1 and 2 |
| D. | 0,1,2 and 3 |
| Answer» C. 3,4,1 and 2 | |
| 40. |
The father of all processes is |
| A. | root |
| B. | sh |
| C. | sched |
| D. | init |
| Answer» D. init | |
| 41. |
The difference between the commands ps –e and ps –a is |
| A. | ps –e gives details of every process running in memory whereas ps –a gives output for all the process that you have launched |
| B. | ps –e gives details of every process running in memory whereas ps –a gives details of all user processes |
| C. | no difference , both give same output |
| D. | none of the above |
| Answer» C. no difference , both give same output | |
| 42. |
Which of following commands do not belong to multiple file editing commands |
| A. | :n! |
| B. | :q! |
| C. | :rnew! |
| D. | all the above |
| Answer» E. | |
| 43. |
The output of command banner “Unix shell programming†would be |
| A. | a banner showing ‘unix’,’shell’ and ‘programming’ words displayed in separate lines |
| B. | a banner showing ‘unix shell’ in one single line |
| C. | nothing |
| D. | a banner showing ‘unix shell programming’ in one line. |
| Answer» C. nothing | |
| 44. |
The command pwd gives |
| A. | present working directory |
| B. | password in encrypted form |
| C. | password in decrypted form |
| D. | none |
| Answer» B. password in encrypted form | |
| 45. |
Which of the following is not a unix command |
| A. | cd |
| B. | rm |
| C. | pwd |
| D. | del |
| Answer» E. | |
| 46. |
A Sticky bit applies to a file would mean that |
| A. | no one can remove it |
| B. | it would stick around in memory even when its execution is over |
| C. | next time you login it would get executed on its own |
| D. | none of the above |
| Answer» C. next time you login it would get executed on its own | |
| 47. |
The permission 746 can be represented as |
| A. | rwxrwx- -x |
| B. | rw- -w-r-x |
| C. | rwxr-xr-x |
| D. | rwxr- -rw– |
| Answer» E. | |
| 48. |
After typing the contents of file test created by you by giving the command cat>test you save the contents by |
| A. | pressing the keys ctrl-c |
| B. | typing save and pressing enter |
| C. | pressing esc key |
| D. | pressing ctrl-d |
| Answer» E. | |
| 49. |
The file for which we do not have write permission can be deleted using the command |
| A. | rm-i file |
| B. | rm-i file |
| C. | rm-r-file |
| D. | rm-f-file |
| Answer» E. | |
| 50. |
If there are three links for a file then the number of copies of the file would be |
| A. | one |
| B. | two |
| C. | three |
| D. | four |
| Answer» B. two | |