Dana Vrajitoru
C151 Multi-User Operating Systems
C151 Homework 2
Due date: Monday, February 8, 2021.
Ex. 1.
Just as before, you will need to copy the content of
the terminal to a file called hw2.txt.
- Find out what your quota is and what part of it you have already
used. The command to use is "quota".
- Display (in the terminal) the list of directories in your home
directory with the total size of the files inside them (without the
subdirectories). The command to use for this is "du" and
you'll need some options to summarize the results.
- Display the major drives on your computer with the command
"df". These three commands were shown in the lecture demos
for C151_02_commands.mp4 from last week.
- Use the command "which" to find the absolute path for the
command "grep" that we have used in the previous
homework.
- Display the current date and time (find this command in the
textbook or you can try to guess it).
- Use the command "ps" with appropriate options to display
all the processes runing on your computer with a long list of details
for each of them. Display the same list using the command
"top". I suggest to copy the contect of the terminal to a
text file before you use the command top because this
command generates a lot of text and you may lose the previous
commands. If you're using the putty option of logging to a file, you
don't need to do this.
-
Launch the application "pico" from the terminal in the
background. For this, run the command terminated with an &
character:
pico &
-
Find out what the process id is for this process (pico). Do
not list all the processes active on your computer again, but only
those running from the terminal. Kill the process named pico
and then list the processes runing from the terminal again to make
sure it's not there anymore.
-
Launch the application "pico" again in the background and
bring it to the foreground. The command to bring the application to
the foreground is "fg" and it is run after the first
application was launched. Exit the editor without writing any file.
- From the list of processes running on your computer, choose one
and write down the process id. Find out if this process uses any
temporary files while running. For this, you need to check the content
of a folder inside /proc with a name identical to the process
id. The lecture demos of this week discuss this aspect.
At this point copy the content of the terminal to the
file hw2.txt.
Canvas Submission
Submit: to Canvas, Assignments, Homework 2, the file
hw2.txt.