

McqMate
These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Computer Science Engineering (CSE) .
201. |
The first set of the three permissions (rw) pertains to the owner of the file, indicating that the owner has |
A. | executable permission only |
B. | write and executable permissions |
C. | both read and executable permissions. |
D. | both read and write permissions |
Answer» D. both read and write permissions |
202. |
Which of the following commands is used to save the output of the who command in a file named user.lst, as well as display it? |
A. | who | tee user.lst |
B. | who > user.lst |
C. | who >> user.lst |
D. | who < user.lste |
Answer» A. who | tee user.lst |
203. |
Which of the following shell's wildcards are used to match any number of characters including none? |
A. | [ijk] |
B. | [!ijk] |
C. | ? |
D. | * |
Answer» D. * |
204. |
Which symbol will be used with grep command to match the pattern pat at the end of a line? |
A. | ^pat |
B. | $pat |
C. | pat$ |
D. | pat^ |
Answer» C. pat$ |
205. |
Which command is used to display all the lines with the string 'sales' from the file empl.lst? |
A. | cut sales empl.lst |
B. | /sales > empl.lst |
C. | grep sales empl.lst |
D. | cat | /sales > empl.lst |
Answer» C. grep sales empl.lst |
206. |
Which of the following commands is note the vi Input mode command? |
A. | rch |
B. | r |
C. | s |
D. | j |
Answer» D. j |
207. |
Which of the following commands is used to remove files? |
A. | erase |
B. | delete |
C. | rm |
D. | dm |
Answer» C. rm |
208. |
Which command is used with vi editor to save file and remain in the editing mode? |
A. | :q |
B. | :w |
C. | q! |
D. | :x |
Answer» B. :w |
209. |
Which of the following commands is used to have a two-way communication with any person who is currently logged in? |
A. | |
B. | mesg |
C. | write |
D. | grep |
Answer» C. write |
210. |
Which command is used with vi editor to move the cursor to the left? |
A. | i |
B. | j |
C. | k |
D. | h |
Answer» D. h |
211. |
Which command is used to terminate all processes in your own system except the login shell? |
A. | kill 1 |
B. | kill 0 |
C. | cancel all |
D. | cancel 1 |
Answer» B. kill 0 |
212. |
Which command is used to link the files? |
A. | ik |
B. | in |
C. | cp |
D. | tar |
Answer» B. in |
213. |
Which of the following signs is used to back up over typing errors in vi? |
A. | @ |
B. | # |
C. | $ |
D. | ! |
Answer» B. # |
214. |
Which of are following internal commands is used in mail to forward mail to user in user-list? |
A. | r user-list |
B. | m user-list |
C. | d user-list |
D. | e user-list |
Answer» B. m user-list |
215. |
Which of the following commands is used to display the filenames in multiple columns? |
A. | ls |
B. | ls -1 |
C. | ls -x |
D. | lc |
Answer» C. ls -x |
216. |
Which of the following features of UNIX may be used for inter process communication? |
A. | signals |
B. | pipes |
C. | semaphore |
D. | all of these |
Answer» D. all of these |
217. |
The command echo welcome > /dev / tty |
A. | echoes welcome in all the terminals that are switched on. |
B. | echoes welcome in all the terminals that are logged on. |
C. | echoes welcome only in the terminal in which it is run. |
D. | both (a) and © |
Answer» D. both (a) and © |
218. |
dev/null |
A. | is a file |
B. | has write permission for all |
C. | is the unix built- in dustbin |
D. | all of these |
Answer» D. all of these |
219. |
The permission bits of a file noname. can be set to _rws_ _x_ _x by the command. |
A. | chmod 711 noname |
B. | chmod go -rw noname |
C. | chmod 2711 noname |
D. | none of the above |
Answer» D. none of the above |
220. |
/bin/passwd has the user execution permission set to 's' because |
A. | this facility assigns to the user, permissions of the program owner. temporarily |
B. | it should allow users who don\t have write permission to /etc/passwd to write to it |
C. | /etc/passwd is write protected |
D. | all of these |
Answer» D. all of these |
221. |
If one doesn't want anyone else to read or write to a file named datfile, except through a program in a file filex , then he may use |
A. | chmod u+s filex ; chmod go_rw datfile |
B. | chmod 4711 filex ; chmod go_rw datfile |
C. | chmod 4711 datfile ; chmod go_rw filex |
D. | both (a) and (b) |
Answer» D. both (a) and (b) |
222. |
Writing a C program that accepts input from keyboard, rather than from a file is advantageous because |
A. | keyboard is a file that is already open |
B. | it can be used in a pipe, if it writes to stdout |
C. | both (a) and (b) |
D. | none of the above |
Answer» C. both (a) and (b) |
223. |
Consider the following command that invokes the executable file a.out, with the following command line arguments a .out God loves you argv( [1][2] )corresponds to the character |
A. | e |
B. | o |
C. | y |
D. | d |
Answer» D. d |
224. |
Which of the following string functions can be used to find the last occurrence of a given character in a given string? |
A. | strncmp |
B. | strncpy |
C. | strchr |
D. | none of the above |
Answer» D. none of the above |
225. |
Consider the program main ( )
|
A. | redirects the output of date to file out f |
B. | displays the output of date on the screen |
C. | prints everything on the screen |
D. | prints the two messages on the screen |
Answer» A. redirects the output of date to file out f |
226. |
The default permission bits of a file when it is created for the first time, is controlled by |
A. | chmod value |
B. | fmask value |
C. | umask value |
D. | none of the above |
Answer» C. umask value |
227. |
Let x.c be a C source code. The command cc x.c > y |
A. | is equivalent to the command cc x.c;mv a.out y |
B. | is equivalent to the command cc -o y x.c |
C. | serves no purpose |
D. | none of the above |
Answer» C. serves no purpose |
228. |
A file x is created with the following contents
|
A. | it echoes the message. followed by date. |
B. | it gives the desired output only if the execute permission of file x is set. |
C. | the desired output can be got by the command sh x. which works even if x has its execute permission not set. |
D. | both (b) and © |
Answer» D. both (b) and © |
229. |
Shell script is preferable to other forms of programming because it |
A. | makes programming task easier |
B. | enhances portability |
C. | occupies less space |
D. | all of these |
Answer» D. all of these |
230. |
Choose the incorrect statements. |
A. | shell scripts can accept arguments |
B. | shell scripts are interpreted |
C. | shell is a programming language |
D. | shell scripts are compiled |
Answer» D. shell scripts are compiled |
231. |
Files that store data in the same format as used in program are called |
A. | binary files |
B. | source file |
C. | text file |
D. | core |
Answer» A. binary files |
232. |
To allow only one user to work with a particular file at a particular time, one has to use |
A. | semaphore |
B. | critical region |
C. | locking |
D. | dedicated mode |
Answer» C. locking |
233. |
Which of the following remarks about realloc are true? |
A. | it allocates memory of required size that need not be contiguous |
B. | it may shift the existing block |
C. | it can work only with an existing block of memory |
D. | both (b) and © |
Answer» D. both (b) and © |
234. |
The differences between malloc( ) and calloc() are: |
A. | malloc is used for dynamic allocation of memory, while cal:1c can't be used for that purpose |
B. | malloc needs only one argument. while cal loc needs two. |
C. | unlike malloc, calloc allocates memory and initializes it to 0. |
D. | both (b) and © |
Answer» D. both (b) and © |
235. |
The file that stores an integer as a sequence of characters is a |
A. | text file |
B. | data file |
C. | binary file |
D. | core file |
Answer» A. text file |
236. |
If cat x. prints garbage. then x is probably a |
A. | data file |
B. | binary file |
C. | text file |
D. | source file |
Answer» B. binary file |
237. |
Which of the following file names can be found in more than one directoy? |
A. | passwd |
B. | bin |
C. | date |
D. | both (a) and (b) |
Answer» D. both (a) and (b) |
238. |
/bin |
A. | is a bucket for storing information |
B. | has files in binary code |
C. | is a directory |
D. | both (b) and © |
Answer» D. both (b) and © |
239. |
The main reasons for the success of pipes are |
A. | the availability of many filter programs |
B. | unix treats devices as files |
C. | it provides a 2- way communication channel |
D. | both (a) and (b) |
Answer» D. both (a) and (b) |
240. |
Which of the following are not filter programs? |
A. | date |
B. | sort |
C. | cat |
D. | grep |
Answer» A. date |
241. |
Redirection in pipes can be achieved by using |
A. | > |
B. | >> |
C. | tee |
D. | lpr |
Answer» C. tee |
242. |
Choose the correct statements. |
A. | the symbols > and | are both processed by shell |
B. | > can be used to direct output to a named file |
C. | | can be used to direct output to programs |
D. | all of above |
Answer» D. all of above |
243. |
The command who sort - file1 > file2 |
A. | results in an error |
B. | sorts the contents of file1 and puts it in file2 |
C. | both (a) and (b) |
D. | none of the above |
Answer» D. none of the above |
244. |
The system identifies a file by its |
A. | name |
B. | absolute path |
C. | both (a) and (b) |
D. | mode number |
Answer» D. mode number |
245. |
The system identifies the end of a file by the |
A. | eof character |
B. | file size |
C. | i-node number |
D. | both (a) and (b) |
Answer» B. file size |
246. |
The command line argument a.out x 'a b' "c d" |
A. | is acceptable |
B. | is acceptable if the double quotes are replaced by single quotes |
C. | is acceptable if the single quotes arc replaced by double quotes |
D. | none of the above |
Answer» A. is acceptable |
247. |
Which of the following metacharacters will be recognized by the shell. even if it comes within double quotes? |
A. | $ |
B. | * |
C. | ? |
D. | none of these |
Answer» A. $ |
248. |
lint should be used |
A. | before compilation |
B. | to analyze a c code |
C. | after compilation |
D. | both (a) and (b) |
Answer» D. both (a) and (b) |
249. |
Environment variables can be accessed by |
A. | system programs |
B. | c programs |
C. | shell scripts |
D. | all of these |
Answer» D. all of these |
250. |
Which of the following are character special files |
A. | terminal |
B. | printer |
C. | modem |
D. | all of these |
Answer» D. all of these |
Done Studing? Take A Test.
Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.