Due Wednesday, September 18.
Please type up your answers in a simple text editor such as Emacs or vi
and submit it by the deadline on Moodle.
The goal of this lab is to explore some of the Unix-like commands available on Mac OSX. By running commands on the
terminal it is possible to investigate the CPU usage, the processes running or the virtual memory used by a specific process.
Warm-up
While doing this lab you should use as much as possible Unix commands, such as:
ls cd cp mv rm mkdir pwd
man chmod cat more grep head tail
ln find rmdir wc diff tar touch
First answer the following about the commands listed above.
- Which do you commonly use?
- Which ones have you never used?
- Select four commands that you are least familiar with. For each
- read through their man page (the command man man might also be helpful),
- describe briefly what the command does, and
- give a couple of examples you tried after reading about the command.
Processes
You should have at least a few applications running. You might be interested in investigating
what happens when you get too many applications running.
For each command below, I would like you to read the man page and do the tasks described.
In the plain text document you submit
- briefly indicate what the command does,
- explain how you completed the task, including the actual commands you used and relevant output
you observed.
Output redirection might be
useful to explain what you did.
Investigate the following five commands.
- ps Try it without a flag and with -ef. One gives back too little, the
other too much. What is the difference? Give one way to limit the output to the processes you started?
(There are many flags that can limit what you get in many ways. grep is also useful.)
- kill Start an application and then kill it. Did you have to force kill
it? as they did...
- top Try it with the flag to order the lines according to CPU usage. Try it on the cs main
server (i.e. royal.cs). Which processes are consuming the most CPU usage on your machine and on the cs server? Explain the
difference?
- vmmap Try it with a few programs you have written: a Java Hello World program, a Java GUI program
or computationally intensive program and with a C program. Comment on the differences.
- iostat Set its display to update regularly. Start a find command in another shell
and see how iostat displays new information. Explain what is happening?
Bonus
Find a command of your choice that relates to OS, such as one that provides information about the
state of the OS, allows you to give commands to the OS, lists signals available. Describe the command and
report on a task you did to experiment with the command.