os_lab task 02
os_lab task 02
Submitted by
Muhammad Haseeb
Roll No.
SU92-BSAIM-F23-054
Program
BS Artificial Intelligence
Submitted to
Ms. Yusra Shafiq
Question #01:
Implementation of command:
pwd
The pwd command displays the current working directory. Simply type pwd to see your
current location within the file system.
ls
The ls command lists the contents of a directory. It shows the current directory you're
in.
mkdir
The mkdir command is is used to create new directories. mkdir directory_name will create a
directory with the specified name. A directory, referred to as a folder in some operating systems,
appears to the user as a container for other directories and files.
touch
The touch command is a standard command used in UNIX /Linux operating system. It
creates an empty file or updates the timestamp of an existing file. touch filename
creates an empty file named filename or updates its last modified time if it already
exists.
cd
Change directory (cd) command changes the current directory and cd directory_name
moves you to the specified directory.
cd ..
It moves you up one level in the directory hierarchy. Simply typing cd .. will take
you to the parent directory of your current location.
cd -
It switches back to the previous directory you were in. By typing cd - toggles you
between the last two directories you’ve visited.
clear:
It clears the terminal screen. By typing clear will remove all previous commands and
outputs from view.
history
It displays the list of previously executed commands. Typing history will show a
numbered list of the commands you’ve executed in the terminal.