0% found this document useful (0 votes)
3 views7 pages

OS Lab

The laboratory report focuses on exploring essential Linux operating system commands, including navigation, file management, and system operations. It details exercises performed by students to create, modify, and remove files and directories using commands like cd, mkdir, and rm. The lab successfully achieved its objective of familiarizing students with these fundamental commands, which are crucial for effective system administration.

Uploaded by

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

OS Lab

The laboratory report focuses on exploring essential Linux operating system commands, including navigation, file management, and system operations. It details exercises performed by students to create, modify, and remove files and directories using commands like cd, mkdir, and rm. The lab successfully achieved its objective of familiarizing students with these fundamental commands, which are crucial for effective system administration.

Uploaded by

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

‭ASTU‬

‭SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTING‬

‭DEPARTMENT OF SOFTWARE ENGINEERING‬

‭OPERATING SYSTEM‬

‭LAB#1‬

‭Group Members‬

‭Name ID‬

‭1.‬ ‭Wondmeneh Fekadu‬ ‭UGR/31346/15‬

‭2.‬ ‭Ergabus Hirpha‬ ‭UGR/30745/15‬

‭Laboratory Report: Linux Operating System Commands‬

‭Course: Operating System‬

‭Instructor: Bushira Ali‬

‭Submission Date: 02/05/2025‬


‭Objective‬
‭ he objective of this laboratory experiment was to explore and understand some of‬
T
‭the most commonly used Linux operating system commands. These commands are‬
‭fundamental in navigating the file system, creating and managing files and‬
‭directories, and performing basic system operations. The main commands covered‬
‭in this lab include cd, mkdir, rm, touch, echo, and others.‬

‭Introduction‬
‭ inux is a popular open-source operating system widely used in server‬
L
‭environments, personal computers, and embedded systems. Understanding the‬
‭basic commands in Linux is essential for effective system administration, file‬
‭management, and scripting. This lab aimed to familiarize students with essential‬
‭commands used for file navigation, creation, modification, and removal in the Linux‬
‭environment.‬

‭Tools‬
‭- VMWARE workstation‬

‭- A Linux-based operating system‬

‭Methodology‬
‭Command‬ ‭Description‬ ‭Example‬

‭pwd‬ ‭Print working directory (shows current path)‬ ‭pwd‬

‭cd‬ ‭Change directory‬ ‭cd Documents/‬

‭cd ../‬

‭cd ~‬
‭ls‬ ‭List directory contents‬ ‭ls -l‬

‭mkdir‬ ‭Make a new directory‬ ‭ kdir‬


m
‭new_folder‬

‭rmdir‬ ‭Remove empty directory‬ ‭rmdir old_folder‬

‭rm‬ ‭Remove files or directories‬ r‭ m [Link], rm -r‬


‭folder/‬

‭cp‬ ‭Copy files or directories‬ ‭ p [Link]‬


c
‭[Link]‬

‭mv‬ ‭Move or rename files/directories‬ ‭ v [Link]‬


m
‭[Link]‬

‭touch‬ ‭Create empty file‬ ‭touch [Link]‬

‭cat‬ ‭Display file content‬ ‭Cat [Link]‬

‭nano / vi‬ ‭Command-line text editors‬ ‭nano [Link]‬

‭vi [Link]‬

‭echo‬ ‭Display a message or variable‬ ‭echo "Hello"‬

‭clear‬ ‭Clears the terminal procedures‬ ‭clear‬

‭history‬ ‭Displays all the command history‬ ‭history‬


‭Procedure‬
‭1.‬ ‭Exercise #1‬

‭ ‬‭Returned from our current directory to our home directory by‬


Ø
‭typing the command > cd /‬

‭ ‬‭Created a new directory and named it “exercise1” by typing the‬


Ø
‭command > mkdir exercise1‬

‭ ‬‭Went to the “exercise1” directory by typing the command> cd‬


Ø
‭exercise1‬

‭ ‬‭Created a new text file and named it “[Link]”. Then the‬


Ø
‭following lines are written into the file‬

‭§‬‭Exercise #1:‬

‭This is a test file‬

‭here is the last line‬

t‭ his is done by typing the command > vi [Link], then written the‬
‭above text into it, Escaped from the text editor.‬

‭ ‬‭Created a new directory under the “exercise1” directory and‬


Ø
‭named it “subdir1” by typing the command > mkdir subdir1‬

‭ ‬‭Went to the new directory and printed the contents of [Link] in‬
Ø
‭exercise1 directory by typing the following commands :-‬

‭§‬‭cd subdir1‬

‭ ‬‭cp /home/mint/exercise1/[Link]‬
§
‭/home/mint/exercise1/subdir1/‬

‭ ‬‭returned to exercise1 directory and count the number of lines in‬


Ø
‭“[Link]” file by typing the command:-‬

‭§‬‭cd ../‬

‭§‬‭wc -l [Link]‬
‭2.‬ ‭Exercise #2‬

‭Ø‬‭Returned to home directory by typing the command > cd /‬

‭ ‬‭Created a new directory and named it “exercise2” by typing the‬


Ø
‭command > mkdir exercise2‬

‭ ‬‭Went into the new directory by typing the command > cd‬
Ø
‭exercise2‬

‭ ‬‭Copied the “[Link]” file from the “exercise1” directory to the‬


Ø
‭“exercise2” directory by typing the command >‬

‭ p /home/mint/exercise1/[Link]‬
c
‭/home/mint/exercise2/‬

‭ ‬‭New directory named “subdir2” is made under “exercise2”‬


Ø
‭directory by typing the command > mkdir subdir2‬
‭ ‬‭The file “[Link]” under exercise2 directory is renamed to‬
Ø
‭“[Link]” by typing the command > mv [Link]‬ ‭[Link]‬

‭ ‬‭All the contents of exercise2 are listed and redirected to the‬


Ø
‭subdir2 and renamed to “ls_out” at the same time by typing the‬
‭command >‬

‭§‬‭ls‬

‭ ‬‭mv [Link]‬
§
‭/home/mint/exercise2/subdir2/Is_out.txt‬

‭ ‬‭everything under the “exercise2” directory is removed by typing‬


Ø
‭the command > rm -r exercise2‬
‭Results‬
-‭ cd: Worked as expected, allowing navigation between directories.‬
‭- mkdir: Successfully created directories.‬
‭- vi: Successfully created and edited text files.‬
‭- echo: Displayed and wrote text to files.‬
‭- rm: Removed files and directories permanently.‬

‭- ls: listed all the directories and files.‬

‭-mv: renamed and moved files from one location to another‬

‭Discussion‬
‭ his lab demonstrated the ease and effectiveness of using Linux commands to‬
T
‭perform basic file and directory operations.‬
‭Mastery of commands like cd, mkdir, rm, touch, echo, and many more is essential‬
‭for navigating and managing files in Linux.‬
‭Although these commands are simple, they form the foundation for more complex‬
‭operations and scripts.‬

‭Conclusion‬
‭ he lab successfully achieved its objective of introducing and practicing essential‬
T
‭Linux commands.‬
‭By using these basic commands, can efficiently manage files and directories in an‬
‭OS environment,‬
‭which is a critical skill for developers. Further practice with these commands will‬
‭increase proficiency in handling more complex tasks in Operating Systems.‬

You might also like