|COMP1011 Exercises for Week 01|
|Computing 1A 05s2||
Tue 19 Jul 2005 14:37
This lab is to be done in your own time in Week 1.
You may find these first laboratory exercises strange or unfamiliar. Do not worry. This is common at first. Just go slowly and carefully and don't be afraid to experiment or redo things which don't quite work the first time.
If something unexpected or puzzling happens or you are not sure what to do, ask another student. If you have troubles you can't solve, you can ask your tutor in Week 2.
Sit in front of a terminal. If the screen is blank, move the mouse to wake it up. In the centre of the screen, there should be a message indicating the name of the laboratory you are in and asking for your account name and password.
(If you have not logged in before, you will need to obtain an account name and password. To do this, type "sirius" as the account name and press the Enter key. For the password, simply press the Enter key. You will then be given a set of instructions to follow. Once these are complete, proceed with the rest of the lab.)
Login using your UNIX account name and password. If you have forgotten these you will have to go to the help desk (in Mechanical Engineering Undercroft).
Once you are logged in two or more windows will appear on the screen. These are called terminal windows. You can type Unix commands in a terminal window and it will process them one at a time.
Move the mouse and watch how the mouse pointer moves. Notice how the pointer changes shape as you move it about the screen.
Interactive commands often print some characters, called a prompt, to indicate they are ready for your input. What characters does a terminal window print to indicate it is ready for your next command?
Use the mouse to move the cursor onto the title bar at the top of a terminal window.
Notice the terminal window moves about.
Some frequently used commands can be run without typing their names.
In a terminal, type the command mozilla &
This runs the web browser Mozilla. Go to the course home page http://www.cse.unsw.edu.au/~cs1011/ All the information about COMP1011 can be found on this web page.
It is essential for you to be able to read your email, as it will be the primary form of communication between lecturers, tutors, and students. If you already know how to use Mozilla mail, or any other mail program on the system, feel free to continue using it. Otherwise, follow these instructions.
Send an email message to someone you know, even to yourself if you like. Your email address is your unix login name followed by @cse.unsw.edu.au
You have just run the Unix command date. Look at the output. It displays the current date and time.
What does this tell you about the names of Unix commands?
Enter the command ls in a terminal. What is the result?
The ls command is used to list the files in the current directory (in
windows directories are called folders). When you first login the curent
directory is your own special home directory. You should see you
have a file called
If your previous ls command did not show a listing of public_html then enter the command mkdir public_html. This creates a new directory, called public_html.
You have just changed into the public_html directory.
You will now create a file within your public_html directory
A few moments later a window for the text editor xemacs will appear on your screen. The xemacs window consist of three parts. On the top, there is the menubar (it contains menu headings like "Buffers", "Files", and so on.) Below the menu bar, there is the main space in which we can edit files. On the bottom of the window, there is the one-line minibuffer. Xemacs uses it to display status messages and sometimes for inputting names of files that you want to load or save, or other information.
Now type type some text such as ....
Haskell is my favourite language and
COMP1011 is my favourite course.
Now check what has happened.
You should see that a file named `aboutme.html' now exists.
We are finished with xemacs, so you can make it exit.
The xemacs window should disappear.
The file permissions, shown on the far left, for the file aboutme.html should look like this:
The last three characters tell you what permissions other people have to access this file. r means thay can read it, w means they can write to it and change or delete it, and x means they can execute it. - means nothing. The last 3 characters are currently --- which means no-one else, but you can access this file.
The file permissions should now look like this
Other people can now read your file, but they still can't change it or execute it.
The cd command used on its own will take you to your home directory.
How is the output different to what it was prior to executing the chmod command?
Your tutor will ask you to show them the file aboutme.html in your Week 2 lab and you will then get a mark for this lab.
To learn more about xemacs, start the editor again.
When using the menubar, you will notice that many menu items have key sequences at their right side. This means that, to invoke the corresponding action, you can use the indicated key sequence, instead of clicking on the menu items with the mouse. After some practise, you will find that using key sequences is much faster than using the mouse. Therefore, expert computer users prefer the use of key sequences over excessive mouse use.
Now try to use the interactive Glasgow Haskell Compiler system (GHCi):
You will be using GHCi a lot during the next couple of weeks.