A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

21. Unix command to change the case of first three lines of file “shortlist” from lower to upper
a. $ tr ‘[a-z]’ ‘[A-Z]’ shortlist | head-3
b. $ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’
c. $ tr head-3 shortlist ‘[A-Z]’ ‘[a-z]’
d. $ tr shortlist head-3 ‘[a-z]’ ‘[A-Z]’
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).$ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’

22. Match the following vi commands in Unix:
List-I                   List-II
a.   :w        i. saves the file and quits
editing mode
b.   :x         ii. escapes unix shell
c.   :q         iii. saves file and remains
in editing mode
d. :sh       iv. quits editing mode and
no changes are saved to
the file

Codes:
     a   b  c  d
a. ii   iii  i  iv
b. iv  iii  ii  i
c. iii  iv  i  ii
d. iii  i   iv ii
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).iii  i   iv ii

23. The Unix Operating System Kernel maintains two key data structures related to processes, the process table and the user structure. Now, consider the following two statements:

I. The process table is resident all the time and contain information needed for all processes, even those that are not currently in memory.
II. The user structure is swapped or paged out when its associated process is not in memory, in order not to waste memory on information that is not needed.

Which of the following options is correct with reference to above statements ?
a. Only (I) is correct
b. Only (II) is correct
c. Both (I) and (II) are correct
d. Both (I) and (II) are wrong
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Both (I) and (II) are correct

24. Consider the following operations to be performed in Unix:

“The pipe sorts all files in the current directory modified in the month of “June” by order of size and prints them to the terminal screen. The sort option skips ten fields then sorts the lines in numeric order.”

Which of the following Unix command will perform above set of operations?
a. ls – l | grep “June” | sort + 10n
b. ls – l | grep “June” | sort + 10r
c. ls – l | grep – v “June” | sort + 10n
d. ls – l | grep – n “June” | sort + 10x
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).ls – l | grep “June” | sort + 10n

25. Which of the following statement(s) is/are True regarding ‘nice’ command of UNIX?

I. It is used to set or change the priority of a process.
II. A process’s nice value can be set at the time of creation.
III. ‘nice’ takes a command line as an argument.
a. I, II only
b. II, III only
c. I, II, III
d. I, III only
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).I, II, III

26. In UNIX, processes that have finished execution but have not yet had their status collected are known as ................
a. Sleeping processes
b. Stopped Processes
c. Zombie Processes
d. Orphan Processes
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Zombie Processes

27. In UNIX operating system, when a process creates a new process using the fork() system call, which of the following state is shared between the parent process and child process?
a. Heap
b. Stack
c. Shared memory segments
d. Both Heap and Stack
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Shared memory segments

28. Which of the following information about the UNIX file system is not correct?
a. Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks.
b. An i-node contains accounting information as well as enough information to locate all the disk blocks that holds the file’s data.
c. Each i-node is 256-bytes long
d. All the files and directories are stored in data blocks
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Each i-node is 256-bytes long

29. Which of the following option with reference to UNIX operating system is not correct?
a. INT signal is sent by the terminal driver when one types < Control-C > and it is a request to terminate the current operation.
b. TERM is a request to terminate execution completely. The receiving process will clean up its state and exit.
c. QUIT is similar to TERM, except that it defaults to producing a core dump if not caught.
d. KILL is a blockable signal.
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).KILL is a blockable signal.

30. What is the function of following UNIX command?

WC – l < a >b&
a. It runs the word count program to count the number of lines in its input, a, writing the result to b, as a foreground process.
b. It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background.
c. It counts the errors during the execution of a process, a, and puts the result in process b.
d. It copies the ‘ l ’ numbers of lines of program from file, a, and stores in file b.
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background.

Page 3 of 7