Starting from:
$30

$24

Operating System Lab Assignment 1 Solution

Instructions:




All the assignments should be completed and uploaded by 5 pm. Marks will be deducted for the submissions made after 5 pm.



Markings will be based on the correctness and soundness of the outputs. Marks will be deducted in case of plagiarism.
3. Proper indentation and appropriate comments (if necessary) are mandatory.
[2+2
marks]


You should zip all the required files and name the zip file as roll_no .zip , eg.
1501cs11.zip.




Upload your assignment ( the zip file ) in the following link: https://www.dropbox.com/request/uulSQFgm4ftxGGrT4J7u



Questions:




Collect the following basic information about your machine using the /proc file system and answer the following questions:



How many CPU and cores does the machine have?



What is the frequency of each CPU ?



How much memory does your system have?



How much of it is free and available? What is the difference between them?



e. What is total number of user-level processes in the system? [5 marks]




A text file welcome.txt consists of the following passage:
“An operating system (OS) is system software that manages hardware, software resources, provides common services for computer programs. Every general-purpose computer must have operating system to run other applications.”










Write a program in shell script to display the followings: A. the number of unique words in the file.

B. the word which is present for maximum number of times in the file. [5 marks]







Suppose you have a fibonacci sequence of length n, where n is a positive integer and multiple of 3. Now you decide to cut down the sequence in three equal segments and do an element-wise sum of the first and third segments. Finally, you concatenate the second segment to the summed segment. Write a program in shell script to represent these
procedures. Display the results after each step. [8 marks]




A folder named OS contains four non-empty and one empty text files. Each of the non-empty files contains different number of sentences. Write a program in shell script to copy the first sentence from each non-empty file to the empty file. The sentences should



be placed based on the ascending order of the size of the non-empty files. [8 marks]

More products