OSY MP PPT
OSY MP PPT
Branch: CO
Sem: 5th
Sub: Operating System
(22516)
Year: 2023-24
Topic:
working with linux terminals &
basic commands, file &
directory manipulation
commands & fifo page
replacement algorithm
2
Sr No. Commands Syntax Description
1. who $who It is used to display who are the users
connected to our computer currently
3
4
ls command: It is used to lists files in the current working directory.
Syntax: $ls
Options Meaning
5
6
rm command: Used to remove the file
Syntax: $rm filename
Example:
$rm abc.txt Removes abc.txt
$rm abc.txt xyz.txt Removes abc.txt and xyz.txt files
$rm * Removes all files
7
cp command: It is used to copies a file to destination file.
If the command contains two file names, then it copies the
contents of 1st file to the 2nd file. If the 2nd file doesn't exist, then
first it creates one and content is copied to it.
But if it existed then it is simply overwritten without any warning.
8
cat command: It is used to create the file and displaying the contents
of file/files.
Syntax:
$ cat >sample (To create a file)
This is sample file in Unix.
<cntrl d>
$ cat sample
where cat is a command and sample is argument. This is sample file in
Unix. User can display contents of more than one file and called as
concatenation.
$ cat listl.txt list2.txt (List two files at a time)
9
touch command: It is the easiest way to
create new, empty files.
Syntax:
$touch filename
Example:
$touch aaa
10
cd command: Used to change directory.
You can use it to change to any directory by
specifying a valid path.
Syntax:
$cd<directoryname>
Example:
$cd/ Changes to root
directory
$cd..
11
12
pwd command: pwd stands for Present Working
directory. Used to see specific directory
Syntax:
$pwd
13
14
First In First Out (FIFO):
15
Example:
Consider page reference string 1, 3, 0, 3, 5, 6,
3 with 3 page frames. Find the number of
page faults.
16
Initially, all slots are empty, so when 1, 3, 0 came
they are allocated to the empty slots —> 3 Page
Faults.
when 3 comes, it is already in memory so —> 0
Page Faults. Then 5 comes, it is not available in
memory so it replaces the oldest page slot i.e 1.
—>1 Page Fault. 6 comes, it is also not available
in memory so it replaces the oldest page slot i.e 3
—>1 Page Fault. Finally, when 3 come it is not
available so it replaces 0 1 page fault.
17
THANK
YOU !
18