Você está na página 1de 6

B.E.

8TH SEMESTER
COMPUTER SCIENCE ENGINEERING
UNIX AND SHELL PROGRAMMING QUESTION BANK
UNIT I

2 marks Question from UNIT - I.


Q.1. Mention the names of the organizations to which the following flavours of UNIX
belong :
1) SCO
2) BSD
3) AIX
4) SOLARIS
Q.2. What do you mean by multiuser operating system?
Q.3. Describe and explain the versions of UNIX operating system.
Q.4. Explain the concept of soft and hard link in brief.
Q.5. What is a shell?
Q.6. Name different types of shells available in UNIX.
Q.7. Explain some parameters used with ls command.
Q.8. Which command is used to display the current working directory in UNIX.
Q.9. Explain why chmod command is used in UNIX.
Q.10. What is vi editor?

7 marks Question from UNIT - I.


Q.1. Comment on the output of the following UNIX commands :
1) ls al
2) ls F
3) ls A
5) ls r
6) ls d
7) ls -f

4) ls R

Q.2. Explain the following commands in VI editor :


1) Cutting a portion of text
2) Copying 4 lines of text
3 Deleting 10 lines in a text
4) Finding and replacing a string
5) Displaying line numbers
6) Executing a shell command inside editor.
7) Undoing the last 5 commands
Q.3. Write short notes on :
1) yacc
2) awk

3) grep

4) ln

Q.4. Mention the different modes of Vi editor and explain how you can move from
one mode to the other mode. Also discuss what can be done in each of these
modes.
Q.5. Explain the following commands :
1) grep
2) touch
3) wall
6) echo
7) ls

4) cp

5) pwd

Q.6. Explain structure of UNIX O/S. Also write different features of UNIX O/S.
Q.7. Describe the salient features of UNIX operating system.
Q.8. Explain in detail about address, data and control bus.
Q.9. Explain the following commands :
1) chmod
2) diff
3) more

4) tr

Q.10. With reference to the vi editor explain how the following operations are
achieved :
1) Yanking
2) Searching and replacing a pattern
3) Joining lines of text
4) Navigation in four directions (without using arrow keys)
5) Running a unix command inside the vi editor.
Q.11. Explain about the history of Unix operating system.
Q.12. Consider the following file emp.list which stores information of employee.
Emp No
2004
2006
1001
4008
2000
1020

Name
Gupta
Agrawal
Krishna
Saxena
Singh
Sen

Position
GM
Director
Manager
Accountant
Director
Executive

Dept
Sales
Marketing
Marketing
Sales
Production
Personnel

DOB
12/12/52
26/09/45
15/02/77
18/04/82
02/12/46
10/08/80

Salary
12000
18000
8000
6000
20000
6000

What will be output of the following grep command on the emp.list.


1) grep Director emp.list
2) grep n sales em.list
3) grep [skSK]*[nana] emp.list
UNIT II

2 marks Question from UNIT - II.


Q.1. Shell in a UNIX system is an interface between the user and the system.
Comment.
Q.2. What do you mean by Bourne shell?
Q.3. What is shell variable?
Q.4. Give the names of some environment variables in UNIX system.
Q.5. Very briefly explain the various meta characters available in UNIX.
Q.6. What is a shell script?
Q.7. Write some looping statements syntax available in UNIX.
Q.8. Explain the use of if-else construct in UNIX with its syntax.
Q.9. What is awk?
Q.10. Define arrays as used in UNIX.

7 marks Question from UNIT - II.


Q.1. Discuss the various metacharacters available in UNIX. Explain with suitable
example.
Q.2. Explain the structure of if-else and case statements of a shell program with
suitable example.
Q.3. Write a shell script to generate Fibonacci series.
Q.4. Explain AWK pattern scanning and processing.
Q.5. Write a shell script to generate the factorial of a given number entered through
keyboard.
Q.6. Write a shell script to find out the presence of a number in the list of number
supplied as a command line arguments with the number to be found given as
first argument followed by the rest of the list.
Q.7. Write a shell script that deletes all lines containing a specified word in one or
more files supplied as arguments to it.
Q.8. Write a shell script that counts total number of lines in each file supplied as
arguments to it.
Q.9. Write a shell script that accepts two file names as an argument and copy the
content of source file to the destination file. If the destination file already exists,
it will ask the user to overwrite it. If the answer is yes, proceed with copy
otherwise dont copy.
Q.10. Write a shell script that accepts two integer arguments and computes the
value of first number raised to the power of the second number.
Q.11. Write a shell script that accepts an integer number and displays the sum of its
digit.
Q.12. Write a shell script for accepting the following information and storing in the
file customer :
1) customer name
2) item description
3) quantity
4) rate.
The user should get the facility to enter as many records as he/she wants.
UNIT III

2 marks Question from UNIT - III.


Q.1. Draw the file system structure of a typical UNIX system.
Q.2. Define buffer header.
Q.3. Buffer cache is a hardware or a software. Justify.
Q.4. What does the directory /etc consists of?
Q.5. What does the directory /dev contains?

Q.6. Define kernel.


Q.7. What is a buffer pool.
Q.8. Give some advantages of buffer cache.
Q.9. Give some disadvantages of buffer cache.
Q.10. Write some operating system sevices.

7 marks Question from UNIT - III.


Q.1. Explain the operating system services provided by the UNIX system.
Q.2. Explain the scenarios of reading a block in the Buffer Cache.
Q.3. Discuss the advantages and disadvantages of buffer cache.
Q.4. Explain the algorithm for reading the contents of block hence explain bread
and bwrite algorithm.
Q.5. How kernel writes the data to the block. Explain advantage and disadvantage
of buffering mechanism.
Q.6. Explain the architecture of UNIX operating system with the block diagram.
Q.7. Write an algorithm for releasing a buffer.
Q.8.Explain UNIX file system layout.
Q.9. Explain various scenarios for retrival of the buffer.
Q.10. Discuss the process of retrieving information from a block into the buffer
cache. Assume that the block is on the hash queue and the buffer is free.
Q.11. With reference to reading and writing disk blocks, explain the following terms :
1) Asynchronous write
2) Delayed write
Q.12. Explain the structure of a buffer pool.
UNIT IV

2 marks Question from UNIT - IV.


Q.1. A file in a UNIX system is not deleted unless all its links are removed.
Comment.
Q.2. Define superblock.
Q.3. Define system calls. Give names of few system calls.
Q.4. Define inode.
Q.5. Name some operations that can be performed on files.
Q.6. What are special files in UNIX.
Q.7. Define pipes.

Q.8. What do you mean by mounting file systems.


Q.9. Give the name of the UNIX command to change permissions on files and
directory.
Q.10. Define links.

7 marks Question from UNIT - IV.


Q.1. Discuss the internal representation of files in UNIX.
Q.2. Discuss the algorithm to allocate disk blocks.
Q.3. Write short notes on :
1) Mounting and unmounting

2) STAT and FSTAT

Q.4. How a new inode number is allocated to a file. Explain iget and iput algorithm.
Q.5. How pipes are different from regular file? Explain read write process in pipes.
Q.6. Explain namei algorithm in detail.
Q.7. Write an algorithm for conversion of a path name to an inode.
Q.8. Explain mount system call.
Q.9. Explain open system call.
Q.10. Calculate the block number and byte offset on that block number if a process
wants to access 9000th byte of a file. One disk block is of 1024 bytes.
Q.11. What is inode? Draw and explain a sample inode.
Q.12. Explain link system call.
UNIT V

2 marks Question from UNIT - V.


Q.1. The fork ( ) is used t spawn a new process. Comment.
Q.2. How kernel switches between parent and child process?
Q.3. Define U area.
Q.4. Briefly explain the init process.
Q.5. Define process state.
Q.6. Define address space of a process.
Q.7. What is a process id?
Q.8. How a process is made to sleep.
Q.9. How a process is intentionally terminated in UNIX.
Q.10. Give names of some Linux versions.

7 marks Question from UNIT - V.


Q.1. Explain the process termination method in UNIX system.
Q.2. Explain the brk ( ) system call to change the size of a process.
Q.3. Describe the life cycle of a process in UNIX.
Q.4. What is the context of a process and what are its various components?
Q.5. Explain the various operations on regions.
Q.6. What are the contents of register level context.
Q.7. Write an algorithm for Wakeup system call.
Q.8. What are regions? Explain briefly.
Q.9. What are the contents of U-area of a process?
Q.10. Explain the algorithm for fork system call.
Q.11. Explain the following terms :
1) process Address Space
Q.12. Write short notes on :
1) Redhat Linux

2) Sleeping process.

2) Ubuntu Linux.

Você também pode gostar