Operating Systems Lab List
Linux Command Based Tasks
1. Install a package in Linux: Use package managers like apt , yum , or dnf (e.g., sudo
apt install package_name for Debian-based systems).
2. View the routing table in Linux: ip route show or route -n .
3. Add a route to the routing table in Linux: sudo ip route add destination via
gateway .
4. Delete a route from the routing table in Linux: sudo ip route delete destination .
5. Ping a remote host in Linux: ping hostname_or_ip .
6. Display the DNS configuration in Linux: cat /etc/resolv.conf .
7. Edit the DNS configuration in Linux: Edit /etc/resolv.conf with a text editor (e.g.,
sudo nano /etc/resolv.conf ).
8. Display the system information in Linux: uname -a , lscpu , or cat /proc/cpuinfo .
9. Shutdown the system in Linux: sudo shutdown -h now or sudo poweroff .
10. Create a zip archive in Linux: zip archive_name.zip file1 file2 .
11. Extract a zip archive in Linux: unzip archive_name.zip .
12. Compress a zip archive in Linux: zip -r archive_name.zip directory .
13. Display the network interfaces in Linux: ip link show or ifconfig .
14. Configure a network interface in Linux: Edit /etc/network/interfaces or use nmcli
(e.g., sudo nmcli con mod interface_name ipv4.addresses ip_address ).
15. Create a new user in Linux: sudo adduser username or sudo useradd username .
16. Delete a user in Linux: sudo userdel -r username .
17. Change the password of a user in Linux: sudo passwd username .
18. Add a user to a group in Linux: sudo usermod -aG groupname username .
19. Remove a user from a group in Linux: sudo gpasswd -d username groupname .
20. Display the members of a group in Linux: getent group groupname .
21. Extract a tar archive in Linux: tar -xvf archive_name.tar .
22. Compress a tar archive in Linux: tar -cvf archive_name.tar directory .
23. Give read, write, and execute permissions to a file or directory in Linux: chmod u+rwx
file_or_directory .
24. Remove read, write, and execute permissions from a file or directory in Linux: chmod
u-rwx file_or_directory .
25. Delete a file using the rm command in Linux: rm filename .
26. Search for a specific pattern in a file using the grep command in Linux: grep
"pattern" filename .
27. Create a symbolic link in Linux: ln -s source_file link_name .
28. Create a hard link in Linux: ln source_file link_name .
29. Change the permissions of a file or a directory in Linux: chmod permissions
file_or_directory (e.g., chmod 755 file_name ).
30. Display the permissions of a file or a directory in Linux: ls -l file_or_directory .
31. Change the owner of a file or directory in Linux: chown username file_or_directory .
32. Change the group of a file or directory in Linux: chgrp groupname
file_or_directory .
33. View the running processes in Linux: ps aux or top .
34. Terminate a running process in Linux: kill pid or killall process_name .
35. Check the disk usage of a file system in Linux: df -h .
36. Check the available disk space in Linux: df -h .
37. Display the total amount of RAM on the machine in Linux: free -h or cat
/proc/meminfo .
38. Display the list of running processes in Linux: ps aux or htop .
39. Search for a specific text within in Linux: grep -r "text" directory .
40. Search for a specific name in Linux: find / -name "filename" .
41. Search for a specific string in a file in Linux: grep "string" filename .
42. Display the current date and time in Linux: date .
43. Display the current working directory in Linux: pwd .
44. Display the current user name in Linux: whoami .
45. Move a file to a different directory in Linux: mv file_name destination_directory .
46. Copy a file to a different directory in Linux: cp file_name destination_directory .
47. Delete a file in Linux: rm file_name .
48. Delete a directory in Linux: rm -r directory_name .
49. Rename a file in Linux: mv old_name new_name .
50. Create a new file in Linux: touch file_name .
51. Display the contents of a file on the screen in Linux: cat file_name or less
file_name .
52. Display the IP address of the machine in Linux: ip addr show or ifconfig .
53. Create a new directory in Linux using the mkdir command: mkdir directory_name .
54. Navigate to the parent directory using the cd command in Linux: cd .. .
55. Display the contents of a file using the cat command in Linux: cat file_name .
56. Copy a file from one location to another using the cp command in Linux: cp
source_file destination .
57. List all the files in the current directory in Linux: ls or ls -a for hidden files.
58. Change file permissions in Linux: chmod permissions file_name (e.g., chmod 644
file_name ).
Algorithm Based Tasks
1. Simulate Producer-Consumer Problem using Semaphores: Write a C program to
implement the producer-consumer problem using semaphores for synchronization.
2. Simulate the Dining Philosophers Problem: Write a C program to simulate the dining
philosophers problem, addressing deadlock and resource allocation.
3. Simulate Bankers Algorithm for Deadlock Prevention: Implement the Banker's algorithm
in C to prevent deadlock by ensuring safe resource allocation.
4. Simulate Resource Allocation Graph for Deadlock Avoidance: Implement a C program
to simulate a resource allocation graph to avoid deadlock conditions.
5. Create processes using fork() system call: Write a C program to create processes using
the fork() system call.
6. Replace processes using exec() system call: Write a C program to replace a process
image using the exec() family of system calls.