McqMate
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 |
251. |
If one exports a variable |
A. | variables placed in the environment by a child process are not inherited by the parent process |
B. | it is passed to all its descendant processes |
C. | it dies when the shell that created it dies |
D. | all of these |
Answer» D. all of these |
252. |
Profilers are |
A. | tools that analyze the run time behaviour of a program |
B. | tools that check a c code for cross file consistency |
C. | tools that keep track of evolving versions of a file |
D. | none of the above |
Answer» A. tools that analyze the run time behaviour of a program |
253. |
The shell command : |
A. | does nothing |
B. | can be used to cause infinite looping |
C. | can take arguments but it cannot act on them |
D. | all of these |
Answer» D. all of these |
254. |
Which of the following tools can be used to keep track of evolving versions of a file |
A. | make |
B. | yacc |
C. | sccs |
D. | dv |
Answer» C. sccs |
255. |
The .(dot) shell command |
A. | can take command line argument |
B. | will fork a child shell to execute the named shell script |
C. | can be used to change the environment of the current shell |
D. | all of the above |
Answer» C. can be used to change the environment of the current shell |
256. |
m4 |
A. | is a macro processor |
B. | can he used to preprocess c code |
C. | can be used to preprocess assembly language program |
D. | none of the above |
Answer» C. can be used to preprocess assembly language program |
257. |
If 7 terminals are currently logged on. then the command date ; who | wc -l, displays |
A. | date followed by 7 |
B. | date followed by 8 |
C. | date followed by 1 |
D. | an error message |
Answer» A. date followed by 7 |
258. |
Choose the correct answers if the command ls -l /dev/mt0 display's brw_rw_ _ _ _ 1 root 3, 0 Apr18 1:05 mt0 |
A. | the \b\ indicates that it is a special file |
B. | mt0 indicates that it is a tape drive |
C. | the \ b\ indicates that data transfer is done in blocks |
D. | all of these |
Answer» D. all of these |
259. |
cat/dev/tty |
A. | throws garbage onto the terminal 1 |
B. | just echoes what you type. line by line |
C. | terminates if one types control at the beginning of a line |
D. | both (b) & © |
Answer» D. both (b) & © |
260. |
The header files used in C programs arc usually found in |
A. | /bin/include |
B. | usr/bin/include |
C. | /dev/ include |
D. | iusr/include |
Answer» D. iusr/include |
261. |
A C program should be compiled with -g option (like cc -g x . c) to use |
A. | proof |
B. | make |
C. | lprof |
D. | sdb |
Answer» D. sdb |
262. |
The difference between a pipe and a regular file is that |
A. | unlike a regular file, pipe is not a file. |
B. | the data in a pipe is transient. unlike the contents of a regular file |
C. | pipes forbid random accessing. while regular files do allow this |
D. | both (b) and © |
Answer» D. both (b) and © |
263. |
Context switch changes the process mode from……… |
A. | user to kernel mode |
B. | kernel to user mode |
C. | kernel mode to the kernel process |
D. | both (a) and (b) |
Answer» D. both (a) and (b) |
264. |
cc command sequentially invokes |
A. | preprocessor. compiler and link editor |
B. | compiler and link editor |
C. | preprocessor, compiler. assembler and link editor |
D. | compiler, assembler and link editor |
Answer» C. preprocessor, compiler. assembler and link editor |
265. |
The cc command |
A. | can take more than one argument |
B. | can act on files with . or . o extension |
C. | creates . o files by default when more than one argument with .,- extension is present |
D. | if provided with more than one argument. immediately terminates it the first argument fails to compile successfully |
Answer» C. creates . o files by default when more than one argument with .,- extension is present |
266. |
The mv command changes |
A. | only the directory entry |
B. | only the directory entry and i-node |
C. | only the i-node number |
D. | none of the above |
Answer» A. only the directory entry |
267. |
Which of the following programs are not interactive? |
A. | passwd |
B. | date |
C. | grep |
D. | both (b) & © |
Answer» A. passwd |
268. |
Choose the correct statements. |
A. | any process has an associated owner id and group id |
B. | effective id defines who you are for the duration of a process |
C. | real id defines who you are for the duration of a process |
D. | both (a) & (b) |
Answer» D. both (a) & (b) |
269. |
No shell script can take input from |
A. | stdin |
B. | the output of the previously executed command redirected to it |
C. | the shell holds the script |
D. | none of the above |
Answer» D. none of the above |
270. |
The disadvantage of a pipe is that |
A. | it is a one way communication channel |
B. | it dies along with the process that created it |
C. | it can\t he shared by unrelated processes |
D. | all of these |
Answer» D. all of these |
271. |
The state of signals are |
A. | preserved across a fork call |
B. | not preserved across an exec call |
C. | preserved across an exec call |
D. | both (a) & (b) |
Answer» D. both (a) & (b) |
272. |
Which of the following displays the exit status of the last executed command? |
A. | echo $4 |
B. | echo $$ |
C. | echo $? |
D. | echo $! |
Answer» C. echo $? |
273. |
Which of the following file names cannot be displayed if la ls* is run? |
A. | .x |
B. | ?x |
C. | both (a) & (b) |
D. | hidden |
Answer» C. both (a) & (b) |
274. |
Which of the following initiates the sequence of events that ultimately allows a user to login? |
A. | clri |
B. | sync |
C. | login |
D. | init |
Answer» D. init |
275. |
What is ‘ps’ command for? |
A. | prints the status |
B. | prints the process status |
C. | prints the execution status |
D. | none |
Answer» B. prints the process status |
276. |
Which command is used to terminate the process? |
A. | wait |
B. | sleep |
C. | kill |
D. | none |
Answer» C. kill |
277. |
Which commaand is use for the copy in unix? |
A. | copy |
B. | cp |
C. | cpy |
D. | none |
Answer» B. cp |
278. |
What is stand for IPC? |
A. | inter procedure communication |
B. | inter process communication |
C. | inter part compare |
D. | none |
Answer» B. inter process communication |
279. |
Which one is best in action between fork() and vfork()? |
A. | fork() |
B. | vfork() |
C. | both |
D. | none |
Answer» B. vfork() |
280. |
fork system call….. |
A. | control the size of memory allocated to a process |
B. | create a new process |
C. | overlay image of a program onto the running process |
D. | finish executing a process |
Answer» B. create a new process |
281. |
exec system call…….. |
A. | create a new process |
B. | finish executing a process |
C. | control the size of memory allocated to a process |
D. | overlay image of a program onto the running process |
Answer» D. overlay image of a program onto the running process |
282. |
wait system call………… |
A. | finish executing a process |
B. | control the size of memory allocated to a process |
C. | synchronize process execution with exit of previously forked process |
D. | overlay image of a program onto the running process |
Answer» C. synchronize process execution with exit of previously forked process |
283. |
brk system call………… |
A. | synchronize process execution with exit of previously forked process |
B. | control the size of memory allocated to a process |
C. | finish executing a process |
D. | overlay image of a program onto the running process |
Answer» B. control the size of memory allocated to a process |
284. |
signal system call………… |
A. | control process response to extraordinary events |
B. | control the size of memory allocated to a process |
C. | synchronize process execution with exit of previously forked process |
D. | overlay image of a program onto the running process |
Answer» A. control process response to extraordinary events |
285. |
Two policies for managing memory are…………… |
A. | swaping and demand paging |
B. | semaphore and deadlock |
C. | scheduling and wait |
D. | none |
Answer» A. swaping and demand paging |
286. |
Schedular module allocate ….. |
A. | processes to cpu |
B. | cpu to processes |
C. | processes to kernel |
D. | none |
Answer» B. cpu to processes |
287. |
The file subsystem accesses file data using a buffering mechanism that regulates …. |
A. | data flow between the kernel and secondary storage devices. |
B. | data flow between secondary storage devices to kernel |
C. | data flow of kernel |
D. | none |
Answer» A. data flow between the kernel and secondary storage devices. |
288. |
The internal representation of a file is given by …….. |
A. | an inode |
B. | semaphore |
C. | pipes |
D. | none |
Answer» A. an inode |
289. |
Every file in unix has ….. |
A. | two inode |
B. | one inode |
C. | no inode |
D. | none |
Answer» B. one inode |
290. |
inode name is also called…… |
A. | file |
B. | link |
C. | file |
D. | file descriptors |
Answer» B. link |
291. |
When a process creates a new file, the kernel assigns it an ……... |
A. | used inode |
B. | unused inode |
C. | integer number |
D. | file number |
Answer» B. unused inode |
292. |
With inode, the kernel contains two data structures…………. |
A. | file table and user file descriptor table |
B. | file system and kernel |
C. | file and semaphore |
D. | none |
Answer» A. file table and user file descriptor table |
293. |
Which of the following is not A system calls? |
A. | chmod |
B. | open |
C. | lseek |
D. | getc |
Answer» D. getc |
294. |
Mounting a file system results in the loading of |
A. | boot block |
B. | super block |
C. | i-node table |
D. | all of these |
Answer» B. super block |
295. |
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 |
296. |
An attempt to read from locked file,results in |
A. | prematured termination |
B. | a deadlock |
C. | an indefinite wait |
D. | none of the above |
Answer» D. none of the above |
297. |
To allow only one user to work with a particular file at a particular time ,one has to ….. |
A. | semaphore |
B. | critical region |
C. | locking |
D. | dedicated mode |
Answer» C. locking |
298. |
Which of the following are character special files? |
A. | terminal |
B. | printer |
C. | modem |
D. | tape drive |
Answer» C. modem |
299. |
Which of the following sections of an executable binary file has all uninitialized data items? |
A. | bss |
B. | data |
C. | header |
D. | symbol |
Answer» A. bss |
300. |
Which of the following files contains information related to password aging? |
A. | shadow |
B. | profile |
C. | password |
D. | all of these |
Answer» C. password |
Done Reading?