Dana Vrajitoru
C151 Multi-User Operating Systems
Homework 1
Due date: Monday, January 23, 2012.
Notes.
- If you are not familiar with the Linux operating system, you
should do the lab 1 before doing this
homework. You'll also need to complete Lab 2
and submit the resulting file lab2.txt.
- This homework does not require a graphical Linux environment and
can be done entirely from an ssh/telnet window (Putty or simple
terminal - see Lab 1).
- Commands to be used in this homework: ls, cd, mkdir, man, pico,
alpine, find.
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 commands that you execute and their
results from the terminal window to this text file. See
the Lab 1 for more detailed explanations. Save
the text file under the name hw1.txt. This is what you'll have to
submit on Oncourse as the result of your homework.
- List all the files in your home directory and display all the
information like size, date when it was 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 a file named "math.h" in the file tree starting from the
directory /usr/.
- Display the first two pages of the manual entry for the
command less (you may have to
copy these to the text file right away since they will disapear once
you exit the man page).
- Change your working directory to the c151 directory created in
lab1. Create a directory calls hw1. Go back to your home directory.
- Using pico, create a file named ".signature". The "." in the file
name is important and the file name should look exactly like that!
Include your name in the signature and anything else you want. Save
this file and exit pico. This file will now be used by pine as your
signature when you send an email.
- List the files in the directory containing descriptions of all the
devices that can be mounted in the filesystem.
- 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 3 of them.
- Use the command diff to find out how similar these files
are. It's a simple command taking two arguments which are the files to
compare. You can find an explanation of this command using the man
command or in the Demo 2 video clip.
- 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 Demo 1.
- 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.
At this point copy the content of the terminal into the file hw1.txt
(commands that you did and results). Submit this file to Homework 1 on
Oncourse.