OS – Labsheet2
Name: Satya Sri Dheeraj Motupalli
Rollno: AM.SC.U4CSE23150
1. Create a file demo with the following contents
2. Find the marks obtained by Clara in all the subjects
3. Print the marks for essentials in the increasing order
4. Find the maximum marks scored in PSAT
5. Find the minimum marks obtained in Cultural
6. Save the marks obtained by all the students in maths into a file and display it in the
terminal using a single command
7. Print the first 3 letters of all student names.
8. Print the contents of file demo in terminal with all alphabets in capital letters.
9. Print all student names after deleting the letter ‘a’
10. Count the number of lines, words and characters in demo file after removing the
letter ‘S’
11. Find the number of students with their names containing the letter a, e or i
12. Find the marks of students whose names starts with ‘b’ (case insensitive)
13. Find the names of students whose names starts with ‘b’ and ends with ‘y’ (case
insensitive)
Shell Programming
1. Write a shell program to perform the following actions in the given order.
a. Create a directory hierarchy in your home folder
Test -> Test2 -> Test3
b. Create a file file1 in directory Test3 with the contents same as output
of the command ls -l
c. Go to directory Test3
d. Find the names of all files and folders in file1
e. Find the names of all files and folders starting with d(case insensitive)
f. Print all words of file1 on a separate line.
g. Go back to your home directory.
2. Write a shell program to perform the following actions in the given order.
a. Create a file numericdata with the following contents
(Hint : First field is referred as Place second as code1 third as code2 and fourth as
code3)
b. Display the details of Places that starts with ‘T’(case sensitive)
c. Display code3 in sorted order(ascending) of the places that start with ‘K’(case
insensitive)
d. Filter code2 that starts with 6 and ends with 4
e. Filter code2 having one or more occurrence of the digit 6.
f. Filter all code1 having one or more occurrence of the digit 5r