DIPLOMA Os Lab Manual
DIPLOMA Os Lab Manual
Best Use
Algorithm Description Advantages Disadvantages
Case
Batch
First-Come, Processes are executed Long average wait
Simple to systems with
First-Served in the order they arrive time; suffers from
implement. long-running
(FCFS) (FIFO queue). the "convoy effect."
jobs.
Jobs where
Selects the process Minimizes Can lead to
Shortest Job execution
with the shortest CPU average wait starvation for longer
Next (SJN) time is
burst time. time. processes.
known.
Each process gets a
Fair to all
fixed time slice
Round Robin processes; High context Time-sharing
(quantum) to execute,
(RR) reduces response switching overhead. systems.
cycling through the
time.
queue.
Operating system lab manual
1] Command: Pwd
Output:
2] Command: mkdir
3] Command: ls
Output:
4] Command: cd
Output:
Operating system lab manual
5] Command: rmdir
Output:
6] Command: touch
Output:
6] Command: rm
Description: Remove file.
Output:
Operating system lab manual
7] Command: cat
Output:
8] Command: mv
Output:
9] Command: date
Output:
Operating system lab manual
Output:
Operating system lab manual
1] Command: find
Output:
2] Command: awk
Output:
3] Command: sed
Output:
4] Command: chmod
directory.
Operating system lab manual
Output:
Operating system lab manual
5] Command: lsof
processes
Output:
Operating system lab manual
Vi and Vim are terminal-based text editors. Vim is an improved version of Vi.
Command Description
vi filename Open a file in Vi editor.
vim filename Open a file in Vim editor.
i Enter insert mode to edit text.
Esc Exit insert mode.
:w Save changes to the file.
:q Quit the editor.
:wq Save and exit.
:q! Quit without saving changes.
2. gedit Commands
gedit is a graphical text editor available for Linux systems (GNOME-based).
Command Description
3. gcc Commands
gcc is a compiler for C and C++ programming languages.
Operating system lab manual
Command Description
gcc -Wall filename.c Compile the file with all warnings enabled.
gcc -O2 filename.c -o output Compile the file with optimization level 2.
gcc file1.c file2.c -o output Compile multiple C files into one executable.
Operating system lab manual
Script:
Output:
Operating system lab manual
content of a file.
Script:
Output:
Operating system lab manual
line.
Script:
Output:
Operating system lab manual
file to another
Script:
Output:
Operating system lab manual
Script:
Output:
Operating system lab manual
Output:
display it.
palindrome.
Operating system lab manual