OS Lab 1

You might also like

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

ST.

XAVIER’S COLLEGE
Maitighar, Kathmandu
(Affiliated to Tribhuvan University)

LAB REPORT ON

OPERATING SYSTEMS (CSC264)

SUBMITTED BY: SUBMITTED TO:

Name: Er. Anuj Shrestha


Faculty/Semester: (NEC Registration No.: 5495)
Roll no.: Lecturer
Dept. of Computer Science
Lab Number: 1

Title: Familiarization to Linux Commands.


Objective: To understand directory and file management and manipulation along with text file
operation and basic Linux commands.

Command Used: Linux Commands

IDE/Platform: Terminal of Linux

Theory:

A command-line interface (CLI) is a text-based user interface (UI) used to run programs,
manage computer files and interact with the computer. Command-line interfaces are also
called command-line user interfaces, console user interfaces and character user interfaces.
CLIs accept as input commands that are entered by keyboard; the commands invoked at the
command prompt are then run by the computer. Today, most vendors offer the graphical user
interface (GUI) as the default for operating systems (OSes) such as Windows, Linux and
macOS.
GUIs are generally more intuitive and easier to use for beginners, as allow users to see files,
folders, and applications visually, making navigation more straightforward and engaging.
GUIs often allow for easy customization of layouts and themes, enabling users to tailor their
experience to their preferences.
CLI can be faster for experienced users since commands can be executed quickly without
navigating through menus. CLIs typically use fewer system resources than GUIs, making
them ideal for low-resource environments or remote systems. CLI allows for easy automation
through scripts, GUIs do not readily support scripting or automation.
Experimentation

Question 1.) Create a directory path "Forth"

Command: mkdir Forth


Command Action:

Question 2.) Create three text files with any naming of your choice.

Command:
1. cd Forth
2. touch file1.txt
3. touch file2.txt
4. touch file3.txt
Command Action:

Question 3.) Edit one of the files using CLI command and save this file

Command: echo “Text written using CLI command” > file1.txt


Command Action:
Question 4.) Copy the contents of this file to another file

Command: cp file1.txt file2.txt

Question 5.) Check to see if the copy instruction was executed

Command: cat file2.txt


Command Action:

Question 6.) Delete any two files from the directory "Forth"

Command: rm file2.txt file3.txt


Command Action:
Question 7.) Delete the non-empty directory "Forth"

Command:
1. cd ..
2. rm –r Forth
Command Action:

Question 8.) Create a directory "A"

Command: mkdir A
Command Action:

Question 9.) Make at least four text files

Command:
1. touch test1.txt test2.txt test3.txt test4.txt

Command Action:
Question 10.) Move one file from A to another directory called B
Command:
1. cd ..
2. cd A
3. mv test1.txt ../B/
Command Action:

Question 11.) Move all the remaining files from A to B using a single instruction
Command: mv A/* B
Command Action:
Discussion:
When providing instructions in the command terminal, the directory has to be correct otherwise, the
command will not deliver the proper action.

Conclusion:

Hence, we got familiarized with windows commands using command line terminal in Windows
operating system.

You might also like