Linux Programming QB
Linux Programming QB
1) i)Why are text editors required? Write brief notes on the text editors supported by Linux.
ii) Explain GNU id detail and describe advantages of Linux in detail.
2) i) What are the different shell responsibilities? Write a shell script to find factorial of the
given number.
ii) Explain the following commands with syntax, options and examples:
a) head b) tail
5 i) Explain briefly about the conditional statements and control structures in Shell
Programming depicting their syntax and an illustration.
ii) Compare shell command substitution and shell file name substitution.
UNIT II
1) i) Explain about link, unlink and symlink ( ) function with their syntax.
ii) Differentiate soft link and hard links.
2) i) Briefly explain about File types and File attributes.
ii) Discuss in detail about file system structure.
3) Explain about the following system calls with example:
a)lseek b)stat c)fstat d)lstat e)dup() f)dup2().
4) i) Write about File and Directory maintenance system calls? Give Syntax and examples.
ii) Write a Linux program to copy the file contents using block by block transferring method.
5) (i) Differentiate the functions of chmod and chown functions.
(ii) Write the syntax for the following
a) opendir() b) readdir() c) closedir() d) seekdir() e)telldir ()
UNIT III
1. What is a process? Write brief notes on the structure of a process.
2. i) Define zombie process and orphan process. Illustrate the same with a C Coding.
ii) List out the supports given by the kernel towards the management of process and signals.
3. i) Describe about different signal functions in Linux with proper examples and also explain
about signal generation and handling.
ii). Discuss in detail about process waiting and process termination.
4. Explain process creation with necessary routines. What are the possible states a process could
enter before its termination?
5. Write detailed notes on the system calls for process management.
UNIT IV
1. Define IPC. Categorize and explain different approaches of IPC on processes over same
computer and different computer.
2. What are pipes? List out their limitations. Explain how pipes are created and used in IPC with
suitable coding.
3. How are named pipes created? How does it overcome the limitations of anonymous pipes?
Explain how reading and writing operations are performed in a named pipe with an example.
4. Define semaphore. Explain how wait and signal operations are used to control the access to
shared resources with an example.
5. Write notes on the following:
i) Semctl() semaphore function
ii) Semget() semaphore function
iii) Semop() semaphore function
iv) Popen and pclose library functions
UNIT V
1. i) Write a program which implements IPC via Shared memory. List out few merits and
demerits of Shared memory. What are the supports given by the Kernel for SM?
ii) List out and explain the basic steps to create a socket and establish a network connection
using Berkeley Sockets.
2. Classify and give brief notes on APIs for Shared memory.
3. i) Differentiate all IPC mechanisms.
ii) Write a Socket Program for Linux with a Server and Client example Code.
4. Differentiate between connection oriented and connectionless socket protocols. Write brief
notes on the system calls which support the IPC using these protocols.
5. i) How could you create and destroy a Berkeley socket.
ii) “Each socket domain requires its own address format: Justify the statement by illustrating
different address formats for different domains.