Unix QB
Unix QB
Unix QB
Module 1:
SL_NO Question Marks
1. Explain with a figure, the kernel and shell relationship in Unix
8
Operating System.
2. What is the use of following commands: echo, ls, who. 6
3. List and explain the salient features of Unix Operating System. 8
4. Explain the use of following commands: printf, passwd, cal. 6
5. Differentiate between internal & external commands inn unix
8
with suitable examples
6. Briefly explain HOME, PATH, wc, pwd. 6
7. Write the outputs of the following commands.
1. cal 8 1984
3
2. echo ‘Today date is ‘date’ ‘
3. date “Date is: %d %h %Y”.
8. How an ordinary user can become a super user and vice versa?
4
Explain with suitable commands.
9. Write the command line to perform the followings:
1. Change current directory to home directory. 2
2. Change to parent of parent directory.
10. Explain the different types of Unix Environment. 5
Sri Sai VidyaVikasShikshanaSamithi ®
SAI VIDYA INSTITUTE OF TECHNOLOGY
(Approved by AICTE, New Delhi, Affiliated to VTU, Recognized by Govt. of Karnataka)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
RAJANUKUNTE, BANGALORE 560 064, KARNATAKA
Phone: 080-28468191/96/97/98 * E-mail: info@saividya.ac.in * URL www.saividya.ac.in
Module 2:
SL_NO Question Marks
1. What is a file? Explain the three categories of files in Unix
8
operating system.
2. Explain the ls command with options. 6
3. Explain the following command with syntax, option &
6
example: mkdir, rmdir, od, mv.
4. What is parent child relationship? Explain with figure, the
6
Unix File System.
5. Explain the chmod command to change file permission using
6
both absolute and relative methods.
6. Explain the following command with syntax and exapme: cat
8
rm cp wc
7. Evaluate the following commands and write the output.
1. ls -l | grep “^d” > file1
2. grep -v “ZEE” news.txt |wc
3. grep “8……$” file1 6
4. grep jai sharma emp.lst
5. grep -c member file1
6. grep ^[^3] filename.
8. What are wild cards? Explain the various shell wild cards
8
with suitable example.
9. Explain the grep command with all the options. 6
10. Apply the shell’s wild cards and write the output.
1. [a-z][1-4]*.txt
2. *.[!c][!p][!p]
3. *[0-3][A-Z] 6
4. chap* [!0-9]
5. chap[0-1][0-9]
6. [A-Z][a-z][0-9]*
11. Explain the three different forms of if conditional statement. 6
12. Write the menu driven shell script to perform the following
operations.
1. List of users.
8
2. File in a directory.
3. Today’s date.
4. Count number of files in a directory.
13. Write a menu driven shell script using case statement to
8
perform all arithmetic operations.
14. Assume you are in /home /kumar, which of these commands
will work when executed in sequence? Explain the proper 7
reasons.
Sri Sai VidyaVikasShikshanaSamithi ®
SAI VIDYA INSTITUTE OF TECHNOLOGY
(Approved by AICTE, New Delhi, Affiliated to VTU, Recognized by Govt. of Karnataka)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
RAJANUKUNTE, BANGALORE 560 064, KARNATAKA
Phone: 080-28468191/96/97/98 * E-mail: info@saividya.ac.in * URL www.saividya.ac.in
Module 3:
SL_NO Question Marks
1. Explain the following API’s along with their prototype
definition and possible cause for failure:
1. open
12
2. write
3. fcntl
4. stat
2. How do you access and modify the time stamps of a file?
Explain the prototype used for that. Write a program to 8
illustrate the usage of the above prototype.
3. Write the prototype and structure of APIs mentioned. Write
a simple program for using these APIs.
12
1. utime.
2. link.
4. Explain the following general file APIs:
1. open()
12
2. fcntl()
3. lseek()
5. Explain the working of the open function with prototype. 10
6. What is an API? Explain why calling an API is more time
4
consuming than calling a user defined function.
7. Explain the following APIs with prototypes.
1. open
2. lseek 8
3. fstat
4. chmod
8. What is the advantage of locking files? Explain mandatory
an advisory locks? Why advisory lock in considered safe? 7
what are the drawbacks of advisory lock? Explain
9. Describe the device file APIs along with a simple program. 8
10. Explain symbolic link file API’s 8
11. Write a c/c++ program to emulate command in unix 4
12. Outline the environment structure of a process and
6
mention any Four environment variables.
13. Draw and explain the summary of starting and terminating
6
a C program.
14. What are the different ways in which a process can
14
terminate normally.
15. With a neat sketch, explain the memory layout of a C
6/10/8
program.
Sri Sai VidyaVikasShikshanaSamithi ®
SAI VIDYA INSTITUTE OF TECHNOLOGY
(Approved by AICTE, New Delhi, Affiliated to VTU, Recognized by Govt. of Karnataka)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
RAJANUKUNTE, BANGALORE 560 064, KARNATAKA
Phone: 080-28468191/96/97/98 * E-mail: info@saividya.ac.in * URL www.saividya.ac.in
Module 4:
SL_NO Question Marks
1. What is process accounting? Write a program to illustrate the
8
generating of accounting data.
2. Explain “system” function with its prototype 4
3. Which is the fastest form of IPC? Explain 10
4. Explain POPEN and PCLOSE function with prototypes and
10
demonstrate its usage with a simple C program.
5. Write a simple C program to illustrate the concept of a co-
5
process.
6. Discuss with an example, the client-server communication
6
using FIFO
7. Write the neat diagrammatic representation of a message
queue with proper labeling. Write the data structure 8
associated with message queue along with its elements detail.
8. Discuss the appilication of FIFOs. 4
9. What is FIFO’s? with a neat diagram explain the client server
10
communicating FIFOs.
10. What is FIFO? Explain how it is used in IPC. Discuss with an
10
example, the client-server communication using FIFOs.
11. Explain client/server communication using FIFO with a neat
10
diagram.
12. Explain different APIs used with message Queues. 10
13. List along with prototype declaration and meaning, the
different types of system calls available to create and 4
manipulate semaphore.
14. Explain shmget, shmctl, shmat, shmdt functions. 12
15. What are semaphores? What is their purpose? List and
10
explain the APIs used to create and control the semaphores.
16. What are semaphores? Explain the APIs along with the
relevant data structure involved in implementation of 10
semaphores.
Sri Sai VidyaVikasShikshanaSamithi ®
SAI VIDYA INSTITUTE OF TECHNOLOGY
(Approved by AICTE, New Delhi, Affiliated to VTU, Recognized by Govt. of Karnataka)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
RAJANUKUNTE, BANGALORE 560 064, KARNATAKA
Phone: 080-28468191/96/97/98 * E-mail: info@saividya.ac.in * URL www.saividya.ac.in
Module 5:
SL_NO Question Marks
1. What are signals? List any four signals along with brief
explanation. Write a program to setup signals handler for 8
SIGALRM and SIGINT signals.
2. What are signals? Write a program to setup signal handler for
6
the SIGINT signal using sigaction API.
3. What is signal? Explain with the program how to setup a
10
signal handler.
4. What is signal? Discuss any five POSIX-defied signals.
10
Explain how to setup a signal handler.
5. What is the use of setjmp and longjmp functions with
8
examples.
6. Write the timeline or program sequence of execution for
8
sigsetjmp and siglongjmp handling.
7. Explain the following APIs along with their prototypes with
3
respect to signals: kill.
8. Write the prototype of ALARM and PAUSE function and
4
explain how they operate.
9. Explain the following APIs along with their prototypes w.r.t
2
Signals: alarm.
10. What are daemon process? Explain the BSD facility adapted
8
by daemon processes for error handling.
11. Define daemon process. Discuss the basic coding rules of
8
daemon process.
12. What are daemon process? Explain daemon characteristics
10
and relation to session and process groups.
13. What are daemon processes? List their characteristics. Write
a program to transform a normal user process into a daemon 10
process. Explain every step in the program.
14. Explain error handling for daemon process with a neat block
diagram. Write the system library functions associated with 8
error logging.
15. What are daemon process? Explain with a neat diagram the
10
error logging facility for daemon process.