Operating Systems Lab Questions
1. Execute `pwd` command and explain `ls` command with various options.
2. Write a C program to perform inter-process communication between parent and child by
using `fork()` system call.
3. Create Directory in Linux and explain remove directory command with files inside.
4. Write a shell script to list only the name of sub-directories in the present working
directory.
5. Write a shell script to find whether a given number is odd or even.
6. Write a program to print the Child process ID and Parent process ID in both Child and
Parent processes.
7. Display the date and time in Linux and explain `man` and `help` commands.
8. Write a program to check all the files in the present working directory for a pattern
(passed through command line) and display the name of the file followed by a message
stating that the pattern is available or not available.
9. Execute `cp` command and move multiple files to destination directory.
10. Write a program that creates two threads: one to increment the value of a shared
variable and another to decrement the value of the shared variable, using a semaphore to
ensure only one thread executes in its critical section.
11. Execute `locate` command and explain `echo` command with example.
12. Write a C program to create a new process and ensure that the parent process waits for
the child process to terminate.
13. Write a shell script to get input values into an array and display it.
14. Write a C program demonstrating overlay concept by passing through command line
argument using `fork()` system call.
15. Write a shell script to find greatest of three numbers.
16. Write a program to print the Child process ID and Parent process ID in both Child and
Parent processes.
17. Write a shell script to find summation of series.
18. Write a program demonstrating process synchronization using semaphore.
19. Write a shell script program to print elements using For Loop.
20. Write a program to print the Child process ID and Parent process ID in both Child and
Parent processes.
21. Execute `chmod`, `cat`, `mv`, `zip` and `unzip` command.
22. Write a shell script to swap two numbers using temporary variable.
23. Execute `ping`, `grep`, `cat`, `cp` and `hostname` command.
24. Write a shell script to check whether the given input is in the increasing order or not.
25. Write a shell script to sort the elements in ascending order.
26. Write a C program to implement message queues using IPC.
27. Write a shell script to search for a given element from array.
28. Write a C program demonstrating use of `fork()`, `wait()`, `sleep()`, and `exit()` system
calls.
29. Write a shell script to find the sum of every two consecutive numbers in the given array.
30. Write a Program to Create 2 child processes, make the parent wait for both the child
processes to complete.
31. Write a shell script to find the difference of every two consecutive numbers in the given
array.
32. Write a program demonstrating dynamic binding using `pthread` library.