Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

Lab Assignment 01 – Lab 01 , Lab 02,

Lab 03

Name: Mohid Anwar

Subject: Operating Systems

Instructor Name: Dr. Rubina Adnan

Section: 4-A

Roll No: SP21-BCS-047

1|Page
Lab No. 01 Installing Linux Distribution
on Virtual Machine, Command-line
Interface, and Basic Command
Structure

Name: Mohid Anwar

Subject: Operating Systems

Instructor Name: Dr. Rubina Adnan

Section: 4-A

Roll No: SP21-BCS-047

2|Page
Question 1
Task 1:
In GUI open the Libre Office writer tool create a document that contains information about your favorite
place. Try the following short- keys while formatting the document.

Figure 1 CRTL C and V

3|Page
4|Page
Figure 2 CRTL+ S

5|Page
Figure 3 CTRL + 0

Figure 4 CRTL + P

6|Page

Figure 5 AFTER CRTL + Z


Lab No. 02 Working with Navigation,
and File & Directory Handing
Commands

Name: Mohid Anwar

Subject: Operating Systems

Instructor Name: Dr. Rubina Adnan


7|Page
Section: 4-A

Roll No: SP21-BCS-047

Date: 29-09-2022
Question 1
Task 1:
Considering the above activities (given solved actvites section), perform the following tasks
• move myfile to mydir1

• copy myfile to mydir2

• copy mydir2 on Desktop

8|Page
• delete mydir1 (get confirmation before deleting)

• Rename myfile to mynewfile

Task 2:
This activity is related to I/O redirection
• Go to Desktop directory

9|Page
• Write the long-listing of contents of Desktop on an empty file out-put-file

• View contents of out-put-file

Task 3:
Considering the lab activities, perform the following tasks
• Go to Desktop directory

• write the contents of mynewfile to newfile

• view the output of both mynewfile and newfile on screen

• write the combined output of mynewfile and newfile to a third file out-put-file

10 | P a g e
(Appended The Contents)

Task 4:
Long list all files and directories in your system and write out-put on a text-file.

11 | P a g e
Lab No. 03 Controlling Access to Files,
and Managing Packages using
Commands

Name: Mohid Anwar

Subject: Operating Systems

Instructor Name: Dr. Rubina Adnan

Section: 4-A

Roll No: SP21-BCS-047


12 | P a g e
Graded Lab Tasks
Task 1:
• You are familiar with adduser command using: man adduser/useradd, man groupadd useradd -
create a new user or update default new user information. Create 3 user accounts (user1, user2, user3)
and add 2 groups (gr1, gr2). add user1 to gr1 and add user2, user2 to gr2.

• Check user ID (UID) and group ID (GID) by listing file /etc/passwd. Find lines with added user.
What is the UID and GID for these accounts? Write command which show UID and GID for your user
name. Create 3 files with touch command: files1, files2, files3.

• Write the command line by using letters with chmod to set the following permissions:

 rwxrwxr-x for file1


 r-x—x—x for file2
 ——xrwx for file3

13 | P a g e
Solution Screenshots
Adding Users

14 | P a g e
Checking User ID, Group ID and File Creation

Changing Permissions

15 | P a g e
16 | P a g e

You might also like