0% found this document useful (0 votes)
32 views

Linux Question Bank

This document contains a list of questions related to Linux programming. It includes questions about kernel role, shells, file commands like cp, mv, grep and attributes. Questions also cover directories, links, I/O redirection, processes, signals, inter-process communication and sockets.

Uploaded by

Kavya Chittipaka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Linux Question Bank

This document contains a list of questions related to Linux programming. It includes questions about kernel role, shells, file commands like cp, mv, grep and attributes. Questions also cover directories, links, I/O redirection, processes, signals, inter-process communication and sockets.

Uploaded by

Kavya Chittipaka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

JBIET

COMPUTER SCIENCE AND ENGINEERING


QUESTION BANK
LINUX PROGRAMMING

S No QUESTIONS

1. State kernel role in Linux?


2. List different types of shells in Linux
3.
4. Find the list of files in a directory along with file attributes.
5. Give the vi editor text editing commands?
6. Define hard link and soft link of a file.
7. Compare CP and MV commands.
8. Illustrate moving of files in Linux environment with examples?
9. What is „rlogin‟ command purpose?
10. Give the use of „telnet‟ command with example?
11. What is ftp and its importance in Unix?
12. Differentiate tar and zip/unzip commands?
How to create a new directory in a specific disc location in Linux
14.
with example?

16. Give the attributes meaning in grep command


20. What is the use of here documents?
Part - B (Long Answer Questions)
Explain Layered architecture and kernel role in Linux with neat
1.
Diagram?
2. Compare the comm., comp and diff text processing utilities.
3. Illustrate the file filter commands with examples
Remember about links of files and describe about kernel role
4.
while creating links.
Describe the issues with creating, copying, moving and deleting
5.
the directory file in linux with examples.

7. Discuss on list of commands in sed.


How to create background job and foreground jobs in Linux? Explain Moving
8. processes to the background and foreground with
an example?
Explain about „ulimit‟ and, mount commands? Illustrate „pg‟ and
9.
more command with example?

Describe about I/O Redirection operations, built in variables in


11.
Shell.
Explain by writing shell script that receives any number of file names as arguments
13. checks if every argument supplied is a file or
a directory?
14. Explain how the shell treat a command line passed to it.
Write an awk script to find the number of characters, words and
15.
lines in a file.
16. Write a shell script to find and delete all file with the word “Unix".
Write a shell script to count the specified number of lines in a text
17.
file without using wc command?
Demonstrate by writing a shell script to find the factorial of a
18.
number.
Explain by writing shell script that receives any number of file
19. names as arguments checks if every argument supplied is a file ora directory?

Explain Moving processes to the background and foreground withan example?


20.

1. Differentiate between afile locking and record locking.


2. Differentiate symlink ( ) and link() functions with example?
3. Define a system call?
4. List the file types supported by linux.
5. Differentiate system call with library function?
6. Compare dot and dot dot notations in the file system?
7. Distinguish relative path and absolute path.
8. Differentiate hard link and soft link
9. List the significance of fcntl arguments
10. List the file API system calls with purpose
11. Give the list of directory API functions
12. Write the syntax for "if" conditionals in Linux?
13. Discuss 3 standard streams in Linux
14. Write a command to display PID of current shell.
15. Write a script to print the first 10 elements of Fibonacci series.
Write a program to create, read and write the contents of directory
1.
File Using directory API.
Explain about symlink ( ) function with example? Explain about
2.
link( )function with example?
Write a program to create, read and write the contents of
3.
Ordinary file using file API.
Explain about unlink ( ) functions with example? Explain about
4.
symlink ( ) functions with example?
Define a system call? Differentiate system call with library
5.
Function?

7. Define symbolic link? Hard link with examples?


8. Differentiate symbolic link instead of a hard link.
9. Define fcntl ( ), read (), write () writen () function with examples?
10. Describe the characteristics of Unix File System.
11. Describe about Low Level File I/O System Calls.
12. Describe usage of dup(), dup2() system calls with example?
13. Define stat () and create () function with examples?
14. Describe open ( ) function in Linux with examples?
15. Differentiate stat ( ), fstat ( ) and lstat() with example?

2. Emulate the ls command using file API


Illustrate to read input from the standard input (stdin) and display
3.
on the standard output (stdout) using file API.
Differentiate and analyze different file creation api functions with
4.
example
5. List and briefly describe the functionalities of standard i/o library.

1. What is a process?
2. State process states
3. Remember the kernel role on process management
4. List the process attributes
5. Give 5 examples of reliable signals.
6. Describe orphan process with example?
7. What is fork() with example?
8. Define zombie processes with example?
9. Write the differences between threads and processes.

11. Differentiate fork() and vfork() with example?


12. Describe exec () with example?
13. Illustrate exit ( ) function?
14. List all flavors of excec() function.
15. Define zombie processes with example?

17. Discuss the two components of the directory file?


18. Distinguish between alarm(), sleep(), pause() functions?
19. Write the difference between reliable and unreliable signals.
20. Explain how to handle signal?
Illustrate about child process creation using fork(), vfork() and
1.
Exec()
2. Discuss about orphan process and zombie process with example?
3. Explain how to terminate process normally or abnormally?
4. Illustrate about redirection of standard output to file abc.txt
5. Write about the kill and raise functions.

6. Differentiate wait () and waitpid() with examples?


7. Explain the mechanism for handling a signal with example?
How many ways a process goes to wait state or termination state
8. forcefully
Describe SIGKILL and SIGINT with examples?
9.
Explain about signal () function? Differentiate the reliable and
10. unreliable signals
Elaborate different versions of exec () with examples?
11.
Differentiate and analyze non-blocking IO operations in both
1.
Windows and Linux operating systems?
Write a program to create a child process and get the processed of
2.
child and parent
Write a program to find sum of odd numbers by child process and
3. sum of even numbers by parent processes of given range numbersusing fork function.
Illustrate to redirect the standard input (stdin) and the standard
4. output (stdout) of a process, so that scanf () reads from the pipe andprintf ()writes into the
pipe?
Illustrate by writing c program where process forks to a child, then
5.
Waits for someone to terminate?
1. What is IPC.
2. List the different mechanisms for inter process communication.
3. Describe FIFO concept with example?
4. What is the use of FIFO comparing with pipe?
5. Describe mkfifo() system call by example?
6. Describe Pipes opening concept with example?
7. Describe pipes? Explain their limitations.
List the message API system calls to create, delete, send and
8.
receive
9. Describe the structure of a message

11. Differentiate between kill() and rise()?


12. What is named pipe?
13. Explain about msgtyp with example?

15. Describe pipe () system call?


1. Describe message queue API with syntax and example?
2. Differentiate pipe and named pipe concepts in IPC process.
Create a pipe to redirect the input of one command to other
3.
Command.
Create a FIFO to build the communication channel between
4. two processes and give the advantages and disadvantages ofFiles.
Illustrate pipes? Explain their limitations. Explain how named pipes
5. are replaced to overcome the drawback of pipe in IPC with an
examples
Explain about shared-memory segment to overcome the
6.
Drawback of message queue with example.
7. Illustrate about V IPC semaphore mechanism with example.
Explain about synchronization and How synchronization is
8.
Achieved with Semaphores?
Explain the structure of a shared memory and kernel data structure
9.
with a neat diagram?
Explain the system functions associated for creating and Destroying
10.
a shared memory?
Explain the following functions with syntax:
11.
(a) stat() (b) read() (c) open() (d) fstat()
Explain about memory management functions malloc(), calloc(),
12.
realloc(), free() with suitable example.
Write a C program for wc command using system calls or library
13.
functions.
Write a c program to read a directory and display all the files in the
14.
given directory.
Discuss the characters that are used as wild cards by the shell.
15. Explain their meaning and illustrate their usage. Write a note on
character class.

3. Message read time in a given message queue.


4. Demonstrate race conditions with shared memory?
Write a c program to send and receive message using pipes.
5. Implement two way communication using pipes.

2. Demonstrate client and server programming using TCP protocol?


3. Explain about socket( ) function in Linux?
4. Explain about accept( ) function in Linux?
5. Explain about bind( ) function in Linux?
6. Explain about read() function in Linux?
Illustrate with a neat diagram about threads, and light weight
7. processes?

9. Differentiate process and threads?


10. Differentiate stream sockets and raw sockets?
11. Demonstrate client and server programming using UDP protocol?
Write primitive is used by server for waiting the client connection
12. requests.
13. Draw the structure of TCP/IP for exchange information between
client and server.
14. List the attributes in socket address functions
15. Distinguish between IPV4 and IPV6.
1. Illustrate pthreadcreate ( ) function with examples?
2. Explain pthreadkill ( ) function with example?
3. Illustrate about POSIX APIs of semaphores?
4. Explain thread synchronization with semaphores with example?
5. Illustrate about Semaphores with examples?
Explain TCP socket connection establishment with a neat
6. diagram?
7. Explain UCP data transfer with a neat diagram?
Demonstrate client and server programming using TCP protocol
8. with Neat diagram?
9. Explain about socket () , listen(), accept( )system calls in Linux?
10. Illustrate about bind (), read(), write() functions in Linux?
11. Explain about sendto () and recvfrom () functions in Linux?

14. Explain about how TCP connections are established and


terminated.

Illustrate by writing a c program to implement UDP client


1. server?
Demonstrate client and server programming using UDP protocol
2. with Neat diagram?
Illustrate by writing a c program to implement TCP client
3. server?

You might also like