0% found this document useful (0 votes)
4 views2 pages

Sample Mid B

The document outlines the mid-semester examination details for the Operating Systems Lab course at DHA Suffa University, including instructions for students and a breakdown of questions. It consists of tasks involving basic Linux commands, a script for printing a star pattern, and a shell script for number analysis. The exam is scheduled for December 11, 2024, with a maximum score of 20 marks.

Uploaded by

Zahid Ali Magsi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Sample Mid B

The document outlines the mid-semester examination details for the Operating Systems Lab course at DHA Suffa University, including instructions for students and a breakdown of questions. It consists of tasks involving basic Linux commands, a script for printing a star pattern, and a shell script for number analysis. The exam is scheduled for December 11, 2024, with a maximum score of 20 marks.

Uploaded by

Zahid Ali Magsi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DHA SUFFA UNIVERSITY

Department of Computer Science


Mid Semester Examinations – Fall 2024
COURSE TITLE: Operating Systems Lab COURSE CODE: ___CS-3002L_
Class/ Section : BS-CS-5A Time Allowed: 2 Hours
Course Instructor: __Mr. Afaq Sabghatullah____________ Max Marks: 20
Date of Exam : 11-12-2024
Student’s Name: _____________________ Reg. No: ___________________
Moderated by: ___Miss Huma_
Note/ Instructions: Answer all the questions.

Code: B
Question 1: Basic Linux Commands [5 marks]

1. Create a directory named ExamB.


2. Inside ExamB, create the following:
a. Two files: [Link] and [Link].
b. A subdirectory named Submissions.
c. Move [Link] into the Submissions directory.
d. Delete the [Link] file.
3. List all files and directories in ExamB in long format
4. Create a file named [Link] inside the ExamB directory.
5. Change its permissions so that:
a. The owner has full permissions (read, write, and execute).
b. The group has read and execute permissions.
c. Others have only write permissions.
d. Verify the updated permissions of [Link] using the appropriate command.

Question 2: Write a script that uses nested loops to print a pattern of stars (*) in the form of a pyramid.
[5
marks]

Page 1 of 2
DHA SUFFA UNIVERSITY
Department of Computer Science
Mid Semester Examinations – Fall 2024

Question 3: Write a shell script that does the following: [10 marks]

1. Accepts a number from the user.


2. Provides the user with a menu of options:
 Option 1: Check if the number is prime.
 Option 2: Display the Fibonacci sequence up to the given number using a recursive function.
 Option 3: Exit the program.

Ensure the script uses a case statement for handling the options, and validate that the user inputs a valid positive
integer

Page 2 of 2

You might also like