Wednesday, 2 November 2016

July, 2010 A8-R4: BASICS OF OS, UNIX AND SHELL PROGRAMMING

July, 2010
A8-R4: BASICS OF OS, UNIX AND 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 “tear-off” answer sheet attached to the question paper, following instructions therein. (1x10)
1.1 A permission of 664 on a file means that a file has which of the following attributes?
A) - r - - r - - r - -
B) - r – x r – x r – x
C) - r w – r w – r - -
D) - r - - r - - r w –
1.2 The find command can be used to get information about files and directories. Which of the
following pieces of information can it find?
A) File ownership
B) The last time when the file was accessed
C) Files bigger than a certain size
D) All of the above

1.3 You go into vi to edit a text file and you get garbage or weird screen display. Which of the
following is the most likely cause.
A) You are editing a binary file.
B) The TERM variable is set incorrectly.
C) You don’t have the proper file permissions.
D) The file is in use by someone else.
1.4 Which of the following is the first file that is executed to set the login environmental variables for
all users in the Bourne Shell?
A) .profile
B) /etc/profile
C) .cshrc
D) None of the above.

1.5 Which of the following commands may not backup devices and special files?
A) tar
B) cpio
C) dump
D) dd
1.6 Which of the following commands is not a filter?
A) man
B) cat
C) pg
D) head
1.7 How many prompts are available in a UNIX system?
A) 1
B) 2
C) 3
D) 4
1.8 Unix can be best described as
A) Single User Single Processing System
B) Single User Multi Processing System
C) Multi User Single Processing System
D) Multi User Multi Processing System
1.9 What does the command ls do?
A) Display the contents of a file
B) Display files and folders, present in the current folder
C) Shows a calendar
D) Open a file
1.10 With what command can you see your user name?
A) pwd
B) I
C) whoami
D) me

2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the “tear-off” sheet attached to the question paper, following instructions therein. (1x10)

2.1 Modifying the unmask will change the access rights of all files in a directory.
2.2 The command echo $home gives the path of your home directory.
2.3 You can use chfn to change the default login shell.
2.4 The rc files are executed by init and are setup in the /etc/init-tab file.
2.5 Hard links can span across file systems.
2.6 Both csh and ksh provide command name aliasing, to allow you to rename commands.
2.7 It is possible to create a new file system in UNIX?
2.8 It is not possible to pass shell variable settings into an awk program?
2.9 vim is compatible with vi.
2.10 For Linux, General Public License (GPL) is a license written by the Free Software Foundation
(FSF) that is designed to prevent people from restricting the distribution of software.

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 “tear-off” answer sheet attached to the question paper, following instructions therein. (1x10)
                                      X                                  Y
3.1 grep                                               A. Complete listing of all the processes currently scheduled
3.2 Kernel                                           B. Structure of the Unix file system
3.3 Pipe                                              C. Acts as resource allocator and manager
3.4 Emacs                                          D. One of the most useful filters in Unix
3.5 more                                            E. To connect processes
3.6 Inode                                           F. Processes instructions
3.7 Hierarchical                                G. Is a visual editor.
3.8 Operating system                        H. Interval between the child terminating and the parent
                                                               calling wait()
3.9 X – Windows                             I. Killing a process
3.10 ps-ef                                        J. Core of the Unix operating system.
                                                        K. Open Source
                                                        L. Several threads of control
                                                        M. Has a client/server architecture
                                                        N. Allows you to browse through a text file
                                                         O. Data structure used to maintain file identification

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 “tear-off” answer sheet attached to the question paper,following instructions therein. (1x10)

A. filesystem                           B. Special files                                  C. i-node
D. kill                                      E. nice                                               F. ampersand (&)
G. process                                H. wait                                              I. zombie
J. getty                                     K. interpreter                                     L. find
M. vim                                     N. pointer                                          O. FTP

4.1 The ________ provides a simple means of transferring files to and from a Unix computer.
4.2 The shell is a type of program called an ________.
4.3 A program is referred to as a ________ while the kernel is running it.
4.4 All the stored information on a Unix computer is kept in a ________.
4.5 The ________ process provides the login: prompt that you see on the terminal screen.
4.6 A link is a ________ to another file.
4.7 Each entry in an i-list is called an ________.
4.8 ________ represent input/output (i/o) devices, like a tty (terminal), a disk drive, or a printer.
4.9 To place a job in the background, simply add the ________ to the end of your shell command.
4.10 4.10 The ________ command is used to set the processing priority of a command.

PART TWO
(Answer any FOUR questions)
5.
a) Discuss the many ways to access a Unix System.
b) How will you set permissions for a file.
c) Describe the various Runlevels used by Linux and Unix.
(4+5+6)
6.
a) Give an example where we use find and grep to search for text strings in many files.
b) What are the differences between cmp and diff commands?
c) What are shell variables?
d) What is a pipe? Give an example.
e) What is relative path and absolute path?
(3x5)
7.
a) Write shell script to print given number in reverse order, for eg. If number is 123 then it must
printed as 321.
b) Write a bash shell script to insert a blank line between paragraphs in a text file.
c) What is vim? How to exit a file in vim?
d) What is a zombie?
(6+3+3+3)
8.
a) What does fork() do? What is the difference between fork() and vfork()?
b) What are the basic functions of an operating system?
c) Explain the client/server architecture for X-windows and its several important characteristics.
(6+4+5)
9.
a) Explain the steps that a shell follows while processing a command.
b) Write short notes on multi tasking, multi programming, multi threading.
c) What are the differences between Linux and UNIX?
(5+5+5)

Download PDF

Next Set