Dana Vrajitoru
C151 Multi-User Operating Systems
C151 Homework 1
Due date: Monday, February 1, 2021.
Notes.
- This homework assumes some familiarity with the Linux operating
system, as acquired from completing Lab 0
and Lab 1.
- This homework does not require a graphical Linux environment and
can be done entirely from an ssh/telnet window (Putty or
simple terminal - see How To
Connect).
- You will continue to train with the commands seen in these labs
and in the lecture.
- Commands to be used in this homework: ls, cd, mkdir,
man, pico, alpine, find, grep.
Ex. 1.
Open a terminal window or a telnet/ssh connection. At the same
time, open a text window. You will have to copy and paste the content
of the terminal into the text file, just like for Lab 0 and Lab 1.
See the Lab 0 for a more detailed explanation
about copying. Save the text file under the name
hw1.txt. This is what you'll have to submit on Canvas as the
result of your homework.
- List all the files in your home directory and display attributes
such as the size, date when they were modified, owner, and
permissions.
- List all the files in the folder /usr/bin/ that
start with the letters "ma". Do not display the details for
them.
- Locate all the files named math.h in the file
system.
- Display the first two pages of the manual entry for the
command less (you will have to copy these to the text file
right away since they will disappear once you exit the man page).
- Change your working directory to the c151
directory created in Lab 0, then into the week1 directory
created in Lab 1. Create a directory called hw1. Go back to
your home directory.
- List all the devices (including hard drives) mounted in
the file system. Hint: the folder /dev contains
this list.
- Change your current working directory to
/usr/include. Find all the files named cmath in this
directory, using the command find with the -name
option. There should be at least 3 of them.
- Use the command diff to find out how similar these
files are (you don't need to copy all the resulting text if it's more
than one page). It's a simple command taking two arguments which are
the files to compare. You can find an explanation of this command
using the command man or in the lecture demo.
- Assuming that you are still in the
folder /usr/include, suppose that you are looking for a
header file containing the prototype for a function called
pthread_join. Find the header file that you need to include
in your hypothetical program.
Hint: use the command grep shown in the first demo in
the lecture.
- Read from the textbook (or look them up on the web) about
the utilities sort, date, echo,
and file. Give an example of using each of them. For the
command sort, create a small text file containing several
lines and use it to illustrate how the command works.
Canvas Submission
Upload to Canvas. At this point copy the content of the
terminal into the file hw1.txt (all the commands that you
executed and the results) or rename the file putty.log
as hw1.txt. Submit this file to Homework 1 on Canvas.