Linux Programming(LP)
Assignment Questions:
1. Explain the following commands with syntax, options and examples:
   (a) head
   (b) tail
   (c) more
   (d) pg.

2. Discuss about various file handling utilities available in LINUX. Quote various options and examples for each.

3.Explain about awk, sed

4. How a file can be described in Unix environment? List and explain about the various types of files in Unix.

1. Define Shell. Explain different types of shells available in UNIX. Explain Shell Responsibilities.

2. (a) Describe any four built in variables in Shell and demonstrate their use giving an example for each.
   (b) Write a shell script to display GUD MRNG, GUD AFTERNOON, GUD NIGHT based on system time whenever user logs on.
   (c) Write a shell script to find the factorial of a number.
3. Explain about Shell Meta Characters, Shell Variables, Environment Variables,I/O Redirection operators.
1. Differentiate between the following terms:
     (a) getc( ) Vs fgetc( )     (b) stat( ) Vs fsat( )
     (c) printf( ) Vs fprint( )    (d) scanf( ) Vs fscanf( ).

2. Write a C  program to print the type of a file for each command line argument.

3. Explain Library functions,system calls, stream errors

4. Explain about stat structure, Symbolic Links & Hard Links.

1. (a) Differentiate between fork( ) and vfork( ).
   (b) Write the syntax of six versions of exec functions and also explain how these functions differ from each other.

2.Define Signal.What are reliable signals? Explain about the primary features of reliable signals functions. Explain alarm,raise,kill,sleep functions.

3.(a) Define Process.What are process identifiers? Mention the commands for getting different IDs of calling process.
  (b) Explain Zombie & Orphan Process.
1. Compare the IPC functionality provided by pipes and message queues. What are the advantages and drawbacks of each? Explain briefly.

2. Write a program and explain how to transfer a large amount of data between two processes using:
   (a) Pipes
   (b) Message queues.

3. Explain about FIFOS.

4. Explain about system APIs for Message Queue.
1. Explain similarities and dissimilarities between the semaphore and shared memory IPC Mechanisms.

2. Write and explain a program to transfer large amount of data between two unrelated processes using shared memory.

3. Explain the kernel data structure for shared memory with a neat diagram. Also explain the APIs associated for creating and destroying a shared memory.

4. Explain with a program how to copy file data from server to client using shared memory.

1. (a) What are the benefits of using multithreaded programming?
   (b) Explain the APIs used to specify the attributes for a thread.

2. (a) Why do each lightweight process need a separate kernel stack?
   (b) Describe the problems with single threaded programming and how it is overcome by multithreaded programming.

3.Explain about the process of creating Thread.
1. Explain the sequence of steps to process various socket functions using TCP protocol.

2. Explain briefly about the following socket APIs with clear syntax:
   (a) socket( )
   (b) bind( )
   (c) listen( )
   (d) accept( ).

3. Explain a stream socket with a illustrative example for client/server program.