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

Linux Practical Assignment_C1.2.

The document outlines a Linux practical assignment for CS432, consisting of three parts: ownership and permissions, process and disk management, and Bash and Python scripting. Students must complete the assignment individually with customized input values and submit a document with screenshots of executed commands. The total grade for the assignment is 5 points, and identical submissions will receive a zero grade.

Uploaded by

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

Linux Practical Assignment_C1.2.

The document outlines a Linux practical assignment for CS432, consisting of three parts: ownership and permissions, process and disk management, and Bash and Python scripting. Students must complete the assignment individually with customized input values and submit a document with screenshots of executed commands. The total grade for the assignment is 5 points, and identical submissions will receive a zero grade.

Uploaded by

JIMMY y
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS432 - Operating Systems 2

Linux Practical Assignment

Linux Practical
Assignment
Total Grade: 5 Points

Important Instructions:
• Each student must complete this assignment individually.
• Customized input values are mandatory (e.g., use your own username, birth date, and
unique system variables).
• Submit a document (PDF/Word) with screenshots of all commands executed commands
and script outputs.
• Cheating or identical submissions will result in a ZERO grade.
CS432 - Operating Systems 2
Linux Practical Assignment

Part 1: Ownership & Permissions (1.5 Points)


User & Group Management:
1. Create a user with your first three letters + last three letters of your name (e.g., linagi).
2. Create a group named after the last four digits of your student ID (e.g., groupadd 2345).
3. Add the user to the group.

Permissions:
1. Create a directory named /home/[your_name]_linux (e.g., /home/linah_linux).
2. Inside this directory, create a text file named after your birth month (e.g.,
December.txt).
3. Change the file’s permission so:
a. You (owner) have full access.
b. Your group has only read and execute access.
c. Others have no access.

Sticky Bit: 1. Create a shared folder


/home/shared_[your_birthdate].

2. Apply a Sticky Bit on this folder.


3. Add a log file inside the folder named [your_username]_log.txt that logs the last 5
executed commands.
CS432 - Operating Systems 2
Linux Practical Assignment

Part 2: Process & Disk Management (2 Points)


Process Management:
1. Start a background process.
2. Find the Process ID (PID) of the running process.
3. Set the process to the lowest priority using nice.
4. Modify the process to the highest priority using renice.
5. Verify the updated priority.
6. Change the scheduling policy to Round Robin (RR) with the maximum scheduling
priority.
7. Verify the updated scheduling policy and priority.
8. Terminate the process and capture the result.

Disk Management:
1. Check disk usage of a directory that contains the most files on your system.
2. Show the folder size of the directory you created home/[your_name]_linux.
CS432 - Operating Systems 2
Linux Practical Assignment

Part 3: Bash & Python Scripting (1.5 Points)


Bash Script:
1. Write a Bash script (yourNickname.sh) that:
2. Defines a function check_divisible_by_4() that:
a. Prompts the user to enter a number (N).
b. Uses a for loop to print all numbers from 1 to N.
c. Uses an if statement to check if a number is divisible by 4.
d. Prints "Divisible by 4" next to the numbers that meet the condition.
Python Script:
1. Takes a number (representing a temperature in Celsius) as input.
2. Uses if-elif to to categorize the temperature:
a. Print "Cold" if the temperature is below 10°C.
b. Print "Moderate" if the temperature is between 10°C and 25°C.
c. Print "Hot" if the temperature is above 25°C.

You might also like