Monday, 24 October 2016

January, 2015 A8-R4: BASICS OF OS, UNIX & SHELL PROGRAMMING

January, 2015
A8-R4: BASICS OF OS, UNIX & SHELL PROGRAMMING

PART ONE
(Answer all the questions)

1. Each question below gives a multiple choice of answers. Choose the most appropriate
one and enter in the “OMR” answer sheet supplied with the question paper, following
instructions therein. (1x10)
1.1 An ________ is a program whose function is to enable other programs to use the computer’s
hardware.
A) Operating system
B) Firmware
C) Application Software
D) All of the above
1.2 Thompson and Ritchie rewrote their UNIX operating system in ________ Language.
A) PASCAL
B) FORTRAN
C) C
D) C++
1.3 University of California at Berkley announced to create its own version of UNIX to be distributed
free of charge unlike AT&T s UNIX
A) BSD Unix
B) GNU
C) HP UNIX
D) SOLARIS
1.4 Stallman developed an operating system that would be freely available and open to all. He
called it ________.
A) GNU
B) LINUX
C) UNIX
D) GPL
A8-R4 Page 2 of 4 January, 2015
1.5 GPL is an acronym for ________.
A) General Public License
B) GNU Public License
C) Global Private License
D) Global Public License
1.6 ________ is not Linux Distribution
A) RedHat
B) Debian
C) Slackware
D) FreeBSD
1.7 All current UNIX Variants are ________ compliant
A) UNIX
B) LINUX
C BSDUX
D) POSIX
1.8 The most common file system type under Linux is ________ Filesystem
A) FAT16
B) FAT32
C) UFS
D) EXT2
1.9 FAT file system does not use ________.
A) DOS
B) WINDOWS
C) INode
D) Block
1.10 UNIX assigns a unique number to every process running in memory called ________.
A) PPID
B) ID
C) Inode
D) PID
2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and
ENTER in the “OMR” answer sheet supplied with the question paper, following
instructions therein. (1x10)
2.1 Unix is a case-sensitive, multiuser operating system.
2.2 Absolute pathname always begin from “/” (root).
2.3 If a directory doesn’t have an execute permission(x) we can never enter into it.
2.4 Character special and block special files are present in /dev directory.
2.5 Compress and pack are file compression utilities in Unix.
2.6 Most of the user processes run in background while system executes its processes in
foreground.
2.7 System processes like sched or vhand can be killed using “kill” command.
2.8 Once jobs submitted using “at” or “batch” commands are executed they are required to be
rescheduled for next execution.
2.9 Shell variable name is any combination of alphabets, digits, and an underscore, and few special
characters as @.
2.10 $? Gives the PID of last background process, whereas $! Gives the exit status of the last
command executed.

3. Match words and phrases in column X with the closest related meaning/word(s)/phrase(s) in column Y. Enter your selection in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)
                            X                                            Y
3.1 Filter                                          A. To ensure that the processes that we have executed should not
                                                             die even when we log out
3.2 nohup                                       B. Priority of a process is decided by a number associated with it.
3.3 nice value                                C. program which can receive a flow of data from standard input,
                                                           process it, and send the results to the standard output.
3.4 ls -al                                        D. list all files whose names are 2 characters long
3.5 umask                                     E. List of all shell arguments
3.6 cmchk                                    F. long list all files including hidden files
3.7 ls ??                                       G. PID of the current shell
3.8 $*                                          H. value that sets the default value of permissions for file or
directory
3.9 Boot Block                              I. command gives the block size
3.10 $$                                         J. contains bootstrap loader and represents the beginning of the
file system
                                                    K. Light weight directory access protocol
                                                     L. Used to shutdown system
                                                    M. Configuration tool to create and modify user information

4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the “OMR” answer sheet supplied with the question paper,following instructions therein. (1x10)

A. 777                                  B. umask                                       C. cron
D. grep                                 E. Eval                                          F. cut
G. 20                                    H. cat                                             I. vhand
J. set                                     K. fork                                            L. expr
M touch

4.1 To create, view or append a file in Unix we use ________ command.
4.2 ________ command searches the specified input globally for a match with the supplied pattern
and displays it.
4.3 ________ is a filter that picks up a given number of character or fields from the specified file.
4.4 ________ stands for user file creation mask, tells what permissions to hide.
4.5 System wide permissions for user file is 666 but for directory it is ________.
4.6 ________ system process is responsible for scheduling the other processes.
4.7 The nice value of a process can range from 0 to 39, with ________ as the default nice value of
a process.
4.8 sched and ________ system processes cannot be killed using the kill signal.
4.9 ________ command is used to change the shell invocation options and arguments.
4.10 ________ command evaluates the command line to complete any shell substitutions necessary
and then executes the command ling.

PART TWO
(Answer any FOUR questions)
5.
a) Draw and explain detailed architecture of UNIX Operating System.
b) Explain the hierarchical file system of UNIX with names of some five important directories.
(9+6)
6.
a) Explain six features of Unix operating system that has made it popular and most trusted
operating system
b) What is a Process? Draw Process state diagram and explain each state and transitions.
(6+9)
7.
a) Write a shell script that add two even numbers and must give an error message if any odd no is
entered.
b) What does following commands do: show output in correct format: (half mark each)
i) cat file11 > file2
ii) ls –ld dir1
iii) cat >> file3
iv) chmod 755 filename
v) who |cut –d “:” –f 1 |grep “Joy”
vi) (date;banner UNIX) > aaa
vii) tail +15 file23
viii) head -18 file34
ix) sleep 30
x) echo $$
c) Write a shell script to generate and display all combinations of 1, 2 and 3.
d) Write a Shell script to change the filenames of all files in a directory from lower case to upper
case.
(4+5+3+3)
8.
a) What is the system daemon process that schedules tasks in UNIX /LINUX? Name three
commands which make use of cron daemon scheduling capability.
b) Explain how crontab excels over at command.
c) Write the format for /etc/shadow file, explain each column.
(7+3+5)
9.
a) Explain for loop in Unix. Write a shell script to rename all files in current directory using for loop.
Newfilename must end with nidhi (e.g file1 is original name, after renaming it should be
file1nidhi_______
b) What do following Unix system variables signify?
HOME PS1 PS2 TERM PATH MAILCHECK
Give default values of PS1 and PS2; change value if possible.
c) Explain export command, give syntax and example.
(5+6+4)

Download PDF