Department of Computing Science
Introduction to Computer Systems
Umeå universitet


A couple of Unix exercises


Electronic mail or email is an important part of a student's daily life since a a great deal of information is distributed this way. Here follows a small exercise.

  1. Start pine
  2. Compose a new mail
  3. Send an e-mail to yourself with the subject: I can email!
  4. Quit pine
  5. Start pine again
  6. Choose Folder Index
  7. Read the mail that you did just send
  8. Remove the mail
  9. If you like to, do all of the above with mutt


When you are going to start using Unix in the future you will probably use some kind of editor. An editor is a program used to edit text, like notepad in windows but much more powerful. Here are some examples of editors, with all of them having their specific pros and cons. You will probably hear people telling you that editor X is better than editor Y all the time in the following weeks. However, pay these people no attention, but try to learn each editor before making up your mind on which editor to use.

Feel free to try all these editors; how to start, open/save files and quit.

  1. Start pico, exit by pressing Ctrl+x.
  2. Start emacs, through the menu (if you're in X). If you are not in X it's exited by pressing Ctrl+X and then Ctrl+c
  3. Start xemacs (can only be started in X), exit through the menu
  4. Start nedit, (can only be started in X), exit through the menu
  5. Start vim and exit by pressing ESC and then write :q and then press ENTER

The file system

By now you should know enough about the filesystem to be able to do something creative. Your future laborations and reports should be saved in a directory named edu in your home directory.

Create a new directory in edu named ci (computerintro). What permissions does the newly created directory have? Is this good?

All answers to the following questions are to be written in a file called ci_exercise in the ci directory. After the exercise you are to hand in a printed copy of this document to the TA (teacher assistent). Now is a good time to use man. Inside parentheses are suggested commands that you could use. These exercises should be done in X.

  1. Start a terminal windows
  2. In what directory are you? (Tip: pwd)
  3. Change directory to /
  4. How many records are there in this directory?
  5. Go to your home directory.
  6. Go to the ci directory
  7. Create an empty file with an editor (or use touch)
  8. Create a new directory (mkdir) in ci and move the file (mv) to that directory
  9. Remove the directory, why can't this be done with rmdir?
  10. What permissions does ci have?
  11. What permissions should you assign to it?
  12. Remember to write answers in the file ci_exercise
  13. Run less on ci_exercise, what happens?
  14. Copy text from another terminal window to ci_exercise.
  15. Done!

X - The graphical user interface

In X there are some nice features that will make a lot of things easier.

To copy and paste in Unix, select the text you wish to copy and then simply place the pointer to where you wish the text to go and press the middle mouse button. The selected text is now pasted. Some programs, however, have the Windows-style (ctrl+c, ctrl+v) style copy-pasting most of you are used to.
Feel free to try to copy and paste between the terminal windows in X.

Be aware that the default X setting here at CS uses "Focus follows mouse", this means that the window under the mouse cursor is the active one.

Department of Computing Science
Umeå University
The information on this page was modified 2014-09-12
Responsible for this page: Webmaster
Address: SE-901 87 Umeå, Sweden
Phone: 090-786 50 00
Fax: 090-786 61 26