Você está na página 1de 11

A8-R3: BASICS OF OS, UNIX AND SHELL PROGRAMMING NOTE: 1. There are TWO PARTS in this Module/paper.

PART ONE contains FOUR questions and PART TWO contains FOUR questions. 2. PART ONE is to be answered in the TEAR-OFFANSWER SHEET only, attached to the question paper, as per the instructions contained therein. PART ONE is NOT to be answered in the answer book.

3.

Maximum time allotted for PART ONE is ONE HOUR. Answer book for PART TWO will be supplied at the table when the answer sheet for PART ONE is returned. However, candidates who complete PART ONE earlier than one hour, can collect the answer book for PART TWO immediately after handing over the answer sheet for PART ONE. TOTAL TIME: 3 HOURS TOTAL MARKS: 100 (PART ONE-40; PART TWO 60) 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. (1 x 10) Which one of the following commands changes or assigns an inode number to file? cp mv chmod chgrp In which of the following case cmd2 does not start running until cmd1 has finished? cmd1 | cmd2 cmd1 ; cmd2 cmd1 & cmd2 cmd1 # cmd2 The command grep ^Form myfile displays those lines that begin with From. displays those lines that end with From. displays those lines that do not contain From. displays those lines that contain more than one instance of From. Consider the following code segment : x=10 y=20 The command to display the product of x and y is expr $x * $y expr $x \* $y echo $x * $y echo $x \* $y

1.1 A) B) C) D) 1.2 A) B) C) D) 1.3 A) B) C) D) 1.4 A) B) C) D)

A8-R3

Page 1 of 6

July, 2004

1.5 A) B) C) D) 1.6 A) B) C) D) 1.7 A) B) C) D) 1.8 A) B) C) D) 1.9 A) B) C) D) 1.10 A) B) C) D)

Which of the following is not a layer in TCP/IP Application layer Transport layer Internet layer Presentation layer Which of the following is not true for tar command? All the users are permitted to use tar. A tar command can be used to store data on a formatted disk only. A file system must be present on the disk before tar can be used to store data on it. tar can be used to store as well as extract files from a disk. The command rm xyz will lead to a dangling link, abc, if it is executed after the command _________. ln s abc xyz ln s xyz abc ln abc xyz ln xyz abc Which of the following is not a part of the inode for a file? File permissions. File modification time. Inode modification time. Name of the directory to which the file belongs. Which of the following statement is true for a sticky bit? If the sticky bit for a file is set, then nobody can delete that file. The sticky bit can be set for ordinary files only. A file with sticky bit set, remains in the memory even after execution of that file is over. Every user of the system can set sticky bit on for their files. Which of the following entries are always present in a directory file? One entry that refers to the root directory and one that refers to the parent directory. One entry that refers to the directory itself and one that refers to the parent directory. One entry that refers to the home directory of the user and one that refers to the parent directory. One entry that refers to the root directory and one that refers to the home directory of the user.

A8-R3

Page 2 of 6

July, 2004

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. (1 x 10) The command ls > ls.out will have ls.out in the list of the files displayed. If a user have write permission over a directory, then it implies that the user can make changes to the file using an editor. The du command returns the disk utilization only for the user who invokes it. The terminal file is a block special file. A multiblock file is always allocated contiguous blocks on the disk. The command $ <abc >xyz cat is a valid command. The tar utility can also be used to backup to a diskette. The fsck command stores the names of the unreferenced files in /lost+found. The /mnt is the only mount point possible in UNIX system. When a user logs out, all the processes started by the user are killed. Match words and phrases in column X with the closest related meaning/ word(s)/phrases in column Y. Enter your selection in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) X Order of search for commands Hidden file Equality operator for integers Protocol for transfer of hypertext Read only mode A daemon process To find and display lines in a file that contains a pattern Remote program execution The command init File compression Y WWW /ect/inittab corn . HOME HTTP = PATH view xhost view grep shell script name -eq tar -x gzip HTML ftp chmod == gunzip

2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 3.

3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10

A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. P. Q. R. S. T. U.

A8-R3

Page 3 of 6

July, 2004

4.

Each statement below has blank space to fit one of the word(s) or phrases in the list below. Enter your choice in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) left to right trap 022 nice sleep superblock abbr right to left B. E. H. K. N. Q. T. a.out set prime.out ? wait * inode block C. F. I. L. O. R. U. xterm exec startx filename extension signal 644 magic number

A. D. G. J. M. P. S. V. 4.1 4.2

The _________ command is used to change the priority of running process. If the system default permissions for an ordinary file in 666 and the umask value is 022, then permissions for the file, a, created by the command cat > a is _________.

4.3 4.4

The command cc prime.c generates _________ as the executable file. A fully qualified domain name (FQDN) is resolved in _________ order by Domain Name Server (DNS).

4.5 4.6

The shell Meta character _________ match any string of zero or more characters in file. The file command differentiates between the various types of files on the basis of _________.

4.7 4.8

The list and the number of free inode blocks available in the system is stored in _________. The system call that stops parent process and let it resume on termination of child process is _________.

4.9 4.10

Unix command to specify what to do upon receipt of a signal is _________. To manually start X server, use _________ on prompt.

A8-R3

Page 4 of 6

July, 2004

PART TWO (Answer any FOUR questions) 5. a) b) Write an awk program, which acts like wc command, i.e., reports the number of lines, words and characters in every file passed to it as command line argument. How are the pointers to the data blocks of a file stored in its inode? Show diagrammatically also. (8+7) 6. a) Differentiate between the following i) ii) iii) A system call, a library function and a UNIX command. /etc/passwd and /etc/shadow User mode and kernel mode in UNIX. (9+6) 7. a) What will be the output of the following codes? Also explain the reason for it. for j in a b c d e f do echo $ done and for j in a b c d e f do echo $j done > f2 b) Write a shell script to read a name and display whether that person is authorized to use the system or not. If the person is authorized, then display whether that person is currently logged in or not. List the three standard file types available in UNIX. Which standard file type is redirected when the following shell metacharacter(s) is used in the commands: - <, >, >>, 2> and | (pipe)? (5+5+5) 8. a) b) c) What is a URL? What are its various components? What is setuid bit? How does it work and what is its importance? What are system run-levels in Unix? How can run-level be changed from command line? (5+5+5) > f1

c)

A8-R3

Page 5 of 6

July, 2004

9. a) What is the difference between internal and external commands available in UNIX? Is it possible to create a shell script with the same name as a UNIX command? On giving that name on the prompt, what will be executed - command or the shell script. Explain w.r.t. both internal and external commands. Write the commands or shell scripts to do the following i) ii) list all the ordinary files with names starting with a vowel and present in the tree structure from the HOME directory downwards. given a file, f1 with record format as RollNo (Alphanumeric field) iii) Name (Alphabetic field) Mark (Numeric field)

b)

Sort f1 on the basic of Marks and store the result in f1.out extract the name and phone fields from a file, f2 with the record format as Name:Age:Address:Phone Display the data on the screen iv) to display the list of last 10 files present in the current directory. (7+8)

A8-R3

Page 6 of 6

July, 2004

A8-R3: BASICS OF OS, UNIX AND SHELL PROGRAMMING NOTE: 1. There are TWO PARTS in this Module/paper. PART ONE contains FOUR questions and PART TWO contains FOUR questions. 2. PART ONE is to be answered in the TEAR-OFFANSWER SHEET only, attached to the question paper, as per the instructions contained therein. PART ONE is NOT to be answered in the answer book.

3.

Maximum time allotted for PART ONE is ONE HOUR. Answer book for PART TWO will be supplied at the table when the answer sheet for PART ONE is returned. However, candidates who complete PART ONE earlier than one hour, can collect the answer book for PART TWO immediately after handing over the answer sheet for PART ONE. TOTAL TIME: 3 HOURS TOTAL MARKS: 100 (PART ONE-40; PART TWO 60) 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. (1 x 10) Implementation of UNIX system is called swapping system, if kernel writes Page of memory to swap device Entire processes to swap device Files to swap device None of the above Interrupts happen in the middle of execution of the instruction on execution of operating system instruction between execution of two instructions None of the above For copying files from one place to another, we may use utility tar cpio dd None of the above Execute permission for file means file may be used as running process copy can be make in order to execute the file read is implied before execution None of the above

1.1 A) B) C) D) 1.2 A) B) C) D) 1.3 A) B) C) D) 1.4 A) B) C) D)

A8-R3

Page 1 of 5

January, 2005

1.5 A) B) C) D) 1.6 A) B) C) D) 1.7 A) B) C) D) 1.8 A) B) C) D) 1.9 A) B) C) D) 1.10 A) B) C) D)

In vi, suppose pressing the character ] takes the cursor to next paragraph. If we give the command d], the The current paragraph is deleted The character with cursor and up to the end of paragraph is deleted The character following the cursor and up to ] character is deleted None of the above Which of the filter command is used for character translation? tr dd sed grep Execution of the program on the remote machine is possible through ftp telnet http None of the above Application programmers in X Windows environment quickly build sophisticated interface to their programs and enforce a uniform look and feel to all part of GUI by using Widget set X toolkit Window manager None of the above Regular expression [^a-zA-Z] means that the first character of the line is letter any character other than a any character that is not the letter None of these To search files which has been accessed in last n days is possible though the utility (with appropriate options) find ls awk None of the above

A8-R3

Page 2 of 5

January, 2005

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. (1 x 10) UNIX kernel provides its services transparently. In UNIX system, mapping of virtual address to physical address is machine independent. Inode specifies the pathname, which accesses the file. Every directory contains at least two filenames. Kernel may allow the mounting the same file system again. The sticky bit is only set by super user. $* and $@ are same. http is the specification language to construct web pages. Ping command is used to test the connecting of network. Tk widget set and Motif widget set both give similar look and feel to the X Windows application. Match words and phrases in column X with the closest related meaning/ word(s)/phrases in column Y. Enter your selection in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) X Execution of the system call Frozen image of what process is doing File type Storing directory file Y A. B. C. D. find FIFO (pipes) User mode Kernel mode ftp Cntl M Binary format

2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 3.

3.1 3.2 3.3 3.4 3.5 3.6 3.7

Moving cursor to middle line in screen window in vi E. The process number of last background command F. The option of sh causing the shell to echo each G. command before its execution with substitution the shell makes A techniques to transfer file from one computer to H. another computer on network Controls access to a X display I. To find the lines containing specific word in a file J. K. L. M. N. O.

3.8 3.9 3.10

M context Text format $! xhost grep -x $$

A8-R3

Page 3 of 5

January, 2005

4.

Each statement below has blank space to fit one of the word(s) or phrases in the list below. Enter your choice in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) inode ls links pair of double quote DNS DISPLAY awk B. E. H. K. N. Q. T. 2dw dw fsmk include www head /etc/passwd C. F. I. L. O. R. is not fsck Pair of single quote export xterm /etc/shadow

A. D. G. J. M. P. S. 4.1 4.2

The kernel _______ a separate set of processes, which run parallel to user process. Number of _______ to the file represents the number of names the file has in the directory hierarchy.

4.3 4.4 4.5 4.6

Reclaiming unlinked disk blocks is done by _______ program. In vi, to delete 12.357 we give _______ command. _______ negates special properties of all enclosed character in UNIX. A variable can be make the part of environment of current shell and of all processes (including shell script) descending from it, by using _______ command.

4.7 4.8

Conversion of domain name to an IP address is done by _______. Applications use the value _______ variable to determine which display, keyboard and mouse to use.

4.9 4.10

_______ utility displays the beginning of the file. All encrypted passwords are kept in the file _______.

PART TWO A8-R3 Page 4 of 5 January, 2005

(Answer any FOUR questions) 5. a) b) Write sequence of vi commands to exchange top three lines with bottom three lines of the screen on the vi session. Write a shell script, which asks user to enter the login name. If the name is not in the LOGFILE, display Sorry! You cannot work., otherwise ask for password. The password in not echoed. Check the password with the PASSWORD. If it is not there display ACCESS DENIED. (7+8) Write a shell script to display login names of all users who have logged off in last 10 minutes. What is the purpose of having /etc/passwd and /etc/shadow files? Write a shell script to print the system time. (7+4+4) What is motivation for weekly or monthly backup? Explain tar utility with examples. Write the shell script to add a new user in password file /etc/passwd with the following details: - group name india - log in name guru - user name Ramauli of Vindhyachal - file system /selected (9+6) What is the design principle of X windows? Describe system architecture and Window manager of X Windows. What is X-toolkits? What does it contain? What is IP address? Explain its construction. Calculate the maximum possible numbers of class A, class B and class C networks, which can be addressed by IP scheme. (9+6) Explain the booting process of Unix system. Describe the data structures associated with processes. How are these affected by exec, form and exit system calls. (9+6)

6. a) b) c) 7. a) b)

8. a) b)

9. a) b)

A8-R3

Page 5 of 5

January, 2005

Você também pode gostar