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 operating system, special files are used to:
A
buffer data received in its input from where a process reads
B
provide a mechanism to map physical device to file names
C
store list of file names plus pointers associated with i-nodes
D
store information entered by a user application program or utility program
Question 5 Explanation: 
Special files: Special files in UNIX operating system are used for I/O devices. In the file system they appear like an ordinary file or a directory. Special files are used to store information about the I/O devices.
Question 6
Match the following in Unix file system:

A
(a)-(iv), (b)-(i), (c)-(ii), (d)-(iii)
B
(a)-(i), (b)-(iii), (c)-(ii), (d)-(iv)
C
(a)-(iii), (b)-(i), (c)-(ii), (d)-(iv)
D
(a)-(iv), (b)-(ii), (c)-(i), (d)-(iii)
Question 6 Explanation: 
Boot block contains the code for making OS ready.
Super block contains information about file.
Inode contains information about file system.
Data block contains info regarding data storage.
Question 7
In Unix, the command to enable execution permission for file “mylife” by all is ____________.
A
Chmod ugo + X myfile
B
Chmod a + X myfile
C
Chmod + X myfile
D
All of the above
Question 7 Explanation: 
chmod→ chmod is the command and system call which is used to change the access permissions of file system objects (files and directories). It is also used to change special mode flags. The request is filtered by the umask. The name is an abbreviation of change mode.
ugo → user,group and others
a→ all permissions
+ → defaultly will take all permissions
R,W,X→ Read(R), Write(W) and Execute(X)
Question 8
What will be the output of the following Unix command ?  $rm chap0\[1 - 3\]
A
Remove file chap0[1 - 3]
B
Remove file chap01, chap02, chap03
C
Remove file chap\[1 - 3\]
D
None of the above
Question 8 Explanation: 
rm → It removes the file in a directory.
\ → It will remove matches with escape sequences in between files [chap0, chap1, chap2, chap3]
According to given command, Option-A is the appropriate answer.
Question 9
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
Question 10
The effect of executing the UNIX command ‘sort –t /| +1 file 1’ is ------
A
sorts the lines of the file 1 in ascending order and place | as delimiter
B
sorts the lines of the file 1 in descending order and place | as delimiter
C
sorts the lines of the file 1 in ascending order after skipping content upto | in each line
D
sorts the lines of the file 1 in descending order after skipping content upto | in each line
Question 11
UNIX command used to compare the successive lines of file 1 with the corresponding lines if file 2 and output a 3-columnar report on lines unique to file 1, file 2 and common to both is ----------------
A
cmp file 1 file 2
B
comm. File 1 file 2
C
diff file 1 file 2
D
comp file 1 file 2
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