lab 0: getting started with linux and emacsEN47/COMP9, Fall 2009 overviewThis lab introduces you to the Linux operating system and the Emacs
text editor, which you will be using to create, edit and run your
programs this semester. You can find the electronic version of this handout linked from the course website at welcome to linuxlogging inThe computers should already be on. If the screen is blank, hit a key on the keyboard and wait a few seconds. If the screen is still blank try a different computer or notify the instructor. If the screen is locked, either move to another machine, or if there are no more computers free, notify the instructor. Now type in your user name and press enter. In the next screen enter your new password. This is a security measure to help you keep others from learning your password. Never reveal your password to anyone! Also, please do not turn your workstation off when you are done. Do log off from Linux before you leave; otherwise someone else could gain access to your account. the linux shellRight click on the desktop and select Terminal from the popup menu. In a moment, a window labeled 'Terminal' will appear. This window is running a Linux shell. The shell takes commands typed on the keyboard and executes them. You should see a prompt followed by a blinking cursor which looks something like this: lab116s{username}: This prompt indicates that Linux is ready to execute your next command. creating your comp9 directoryUnlike Windows, in which the file hierarchy starts with a drive
letter and a You should create a directory within your home directory (a subdirectory) to store all of your COMP9 files. To create ("make") this new directory, type this at the command prompt: mkdir comp9 Next change your current working directory to cd comp9 For more information on the using emacsGNU Emacs is a text editor you will use to create and edit your C++ programs. For the most part, you can use Emacs like any other document editor such as Microsoft Word or Notepad; the characters you type will be inserted into the file you are editing. starting emacsType ~/comp9/hello.txt The first part of the file name might appear already. Emacs knows it should look for a file in the current working directory. In general, you can use any filename you want. If the file does not exist, Emacs will create an empty file for you with that filename. In other words, to create a new file, just pick a filename that doesn't already exist. Now that you are in Emacs, you can type anything you wish. Enter a few lines to try it out. saving a file and exitingWhen you are finished editing a file, save it by clicking on the Save button
in the top toolbar. At the bottom of the screen you will see a message
getting comfortable with linux and emacsThe best way to learn these systems is to use them. In this part of the lab, you will practice some common Linux commands and edit the lab report using Emacs. Using Emacs, create a new file called
// File: lab0.txt // Name: [put your name here] // Date: [put the date here] // Overview of Linux commands Save this file. Then bring the terminal window to the foreground and type the following: ls You should see your file navigating the filesystemFor each of the following steps, you will need to switch back and forth
between the terminal window and the Emacs window. Enter commands at the Linux
prompt and record your findings in the file
handing inWhen you are done with the assignment, submit it to be graded by doing the
following. First make sure your current working directory is the one
containing provide comp9 lab0 lab0.txt This semester, we will use the the desktop environmentYou've had a chance to practice navigating the Linux filesystem by typing at the command prompt. Many Linux machines (including the ones in 116) also have a desktop environment, a graphical user interface that runs on top of the operating system. The windows, icons, and menus might look familar to you, as this interface is similar in many ways to that of Windows and Mac. On your desktop, you should see an icon for your home directory. Clicking on it brings up a graphical file browser. This is another way to navigate the Linux filesystem. You should be able to see the files and directory structure that you created earlier using commands in the terminal window. With the time left in the class, feel free to continue exploring the programs and utilities installed on the Linux machines. brief summary of some linux and emacs commandsBelow is a very brief summary of Linux and Emacs commands. some linux commands
some emacs commandsMany Emacs commands use special character combinations with
modifier keys. For example, Another modifier is the Meta key, which used to look like a black diamond
next to the Alt key on Unix keyboards. On the lab machines, the Alt key can be used instead for Emacs commands. For example, Many of the commands in Emacs require two or more keystrokes.
|