OSY PR
OSY PR
Date date
time time ls
cal cal
TTY tty
script script
who who
who am I whoami
login login
passwd passwd
pwd pwd
3)
vi filename.txt
b) Run commands to start, stop, and restart the specified service in Linux
ps aux
ls -l
mkdir new_directory
7) Execute text processing tr,wc, cut, paste, spell, sort grep, more
vi filename.txt
9) Write and execute Shell Script using following control statement features-
"if" statement
#!/bin/bash
else
Fi
10) Write and execute Shell Script using following control statement
features- "for" statement
#!/bin/bash
for i in {1..5}
do
done
11) Write Shell Script to find out whether- Given file exists?
#!/bin/bash
if [ -e "$filename" ]; then
else
fi
12) Write Shell Script to find out whether- File has read, write and execute
permissions?
#!/bin/bash
read filename
if [ -e "$filename" ]; then
else
Fi
13) Write a program to calculate total waiting and turnaround time of n
processes with First Come First Serve CPU scheduling algorithm.
#include <stdio.h>
totalWT += wt[i];
totalTAT += tat[i];
int main() {
int n;
printf("Enter the number of processes: ");
scanf("%d", &n);
int bt[n];
scanf("%d", &bt[i]);
calculateTimes(n, bt);
return 0;
#include <stdio.h>
int found = 0;
if (!found) {
pageFaults++;
else {
frame[capacity - 1] = pages[i];
printf("Frame: ");
printf("\n");
int main() {
int n, capacity;
scanf("%d", &n);
int pages[n];
fifoPageReplacement(pages, n, capacity);
return 0;