UNIX-Operating-System

Question 1

Which of the following commands or sequences of commands will rename a file x to file y in a unix system?

I. mv y,x
II. mv x,y
III. cp y, x(rm x)
IV. cp x, y (rm x) 
A
II and III
B
II and IV
C
I and III
D
II only
Question 1 Explanation: 
Note: Out of syllabus.
Question 2

A student wishes to create symbolic links in a computer system running Unix. Three text files named "file 1", "file 2" and "file 3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file 1 contains information about her hobbies, file 2 contains information about her friends and file 3 contains information about her courses. The student executes the following sequence of commands from her current working directory

ln -s file 1 file 2
ln -s file 2 file 3 

Which of the following types of information would be lost from her file system?

(I) Hobbies (II) Friends (III) Courses
A
(I) and (II) only
B
(II) and (III) only
C
(II) only
D
(I) and (III) only
Question 2 Explanation: 
Note: Out of syllabus.
Question 3

A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl-C input is given to this process, what is the mode in which the signal handling routine executes?

A
kernel mode
B
superuser mode
C
privileged mode
D
user mode
Question 3 Explanation: 
Note: Out of syllabus.
Question 4

The contents of the text file t1.txt containing four lines are as follows:

a1 b1
a2 b2
a3 b2
a4 b1 

The contents of the text file t2.txt containing five lines are as follows:

a1 c1
a2 c2
a3 c3
a4 c3
a5 c4 

Consider the following Bourne shell script:

awk - F''' {Print S1, S2} ' t1.txt |
while read a b ; do
            awk -v aV = Sa - v bV = Sb - F''
            'aV = = S1 (print aV, bV, S2 )'t2.txt
done 

Which one of the following strings will NOT be present in the output generated when the above script in run? (Note that the given strings may be substrings of a printed line.)

A
"b1 c1"
B
"b2 c3"
C
"b1 c2"
D
"b1 c3"
Question 4 Explanation: 
Note: Out of syllabus.
Question 5
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
Question 5 Explanation: 
→ An orphan process is a computer process whose parent process has finished or terminated, though it remains running itself.

→ A zombie process or defunct process is a process that has completed execution but still has an entry in the process table.

→ A process enters a Sleeping state when it needs resources that are not currently available. At that point, it either goes voluntarily into Sleep state or the kernel puts it into Sleep state. Going into Sleep state means the process immediately gives up its access to the CPU.

→ A stopped process is a stochastic process that is forced to assume the same value after a prescribed (possibly random) time.

Question 6
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
Question 6 Explanation: 
A segment of memory that is shared between processes. The shared memory segments are sharing between the parent process and child process.
Question 7
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.
Question 7 Explanation: 
FALSE: Each i-node is 128 bytes long.
Question 8
Which of the following options with reference to UNIX operating system is not correct?
A
INT signal is sent by the terminal driver when one types 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.
Question 8 Explanation: 
KILL

→ The kill command will kill a process using the kill signal and PID given by the user.

→ The kill command accepts either a signal number or name (signals have both a number and name that can be referenced). The name must be in all caps.

Question 9
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.
Question 9 Explanation: 
wc [options] filenames
WC → Word count
Options:
wc -l : Prints the number of lines in a file.
wc -w : prints the number of words in a file.
wc -c : Displays the count of bytes in a file.
wc -m : prints the count of characters from a file.
wc -L : prints only the length of the longest line in a file.
WC – l < a >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.
Question 10
Which of the following statements is not correct with reference to cron daemon in UNIX O.S. ?
A
The cron daemon is the standard tool for running commands on a predetermined schedule.
B
It starts when the system boots and runs as long as the system is up.
C
Cron reads configuration files that contain list of command lines and the times at which they invoked.
D
Crontab for individual users are not stored.
Question 10 Explanation: 
→ The cron daemon is a long-running process that executes commands at specific dates and times.

→ The crontab command creates a crontab file containing commands and instructions for the cron daemon to execute.

→ The cron daemon is the standard tool for running commands on a predetermined schedule.

→ It starts when the system boots and runs as long as the system is up.

→ Cron reads configuration files that contain list of command lines and the times at which they invoked.

Question 11
Consider the file named ‘file 1’. In order to remove write permission to the owner and grant execute permission to others, which of the following UNIX commands in appropriate?
A
chmod u–w,o+x file 1
B
chmod u-w,o-w file 1
C
cheperum u-w, o+e file 1
D
chmod u-w,o+e file 1
There are 11 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access