![]() |
School of Computer Science
|
You will now be logged in and the KDE desktop environment to Unix started up. On the bottom left of the screen you will find the Red Hat icon. This is equivalent to the Windows 'start' button. Clicking on this will open up a number of menus giving you access to various applications.
On the left of the screen you will see an icon of a folder labeled 'Home Directory'. If you double click on this the Konquerer file manager window will open up. This will be similar to Windows Explorer and you can use this to find files, and copy, move, rename and delete files. You can also use Konquerer as a web browser. Typing http://www.csse.uwa.edu.au into the location field will take you to the Department's home page. All course materials are found off the 'Undergraduate' Link. An alternative browser is Mozilla which can be launched from the icon on the bottom taskbar.
If you want to reboot the computer and start Windows 2000 you should select shutdown from the login panel, and then select restart.
Commands are entered into console windows (like the MSDOS prompt window). Open a console window by clicking on the computer monitor icon on the bottom tool bar. When you open a console window you will be placed in your home directory. This is the directory in our system where you will keep your files.
The basic operations that you want to perform in any operating system are file copying, renaming and deleting, the ability to move between directories/folders, and the ability to list the contents of a directory/folder.
> lsDirectories will be displayed in blue and have a trailing '/' symbol
> ls -a lists all files (including hidden ones) > ls -l provides a long listing with extra file information
> cd directory_nameThis changes the current working directory (the one that you are working in) to the new one that you have specified.
To 'step up' to the parent directory type
> cd .. The '..' means parent directory (do a ls -l)If you do this you will be placed in the directory that holds all the directories of your colleagues. A ls command will list them all out. Use a cd your_login_name to move back into your own directory.
> mkdir directory_name
> pwdThis will be something like
/home/year3/your_user_name- your home directory is a subdirectory of year3, which is a subdirectory of the main home directory. You will also find that the title bar of each console window will display the current working directory.
> cp file_name copied_file_name
> mv file_name new_file_name
> rm file_name (there is no way back...)
Some other quick ways for repeating previous commands are given below:
> !! (to repeat the previous command)
> !mo (to repeat the previous command that
begins with the letters "mo")
> ls file1.m
> rm !$ (!$ would be substituted by the last
argument from the previous command,
which is file1.m in this example. So
the command becomes:
rm file1.m
)
> tar cvf ~/portfolio.tar * (the archive file is portfolio.tar
in your home directory; * represents
all the file and subdirectory names)
> tar cvfz ~/portfolio.tgz * (the option 'z' denotes that compression
should be applied. So ~/portfolio.tgz
is smaller than ~/portfolio.tar.)
Note that the command extension for an archive file and
a zipped archive file are .tar and .tgz
respectively.
To display the contents of an archive file:
> tar tvf ~/portfolio.tar > tar tvfz ~/portfolio.tgz
To retrieve all the files and subdirectories from an archive file:
> tar xvf ~/portfolio.tar > tar xvfz ~/portfolio.tgz
For more information about the tar command, type: man tar.
Note that the tar command retains the subdirectory structure on retrieval. So it is extremely useful for archiving all your Matlab source files, image files, etc., for your portoflio for final submission. The zip command under Unix/Linux is compatible with the zip and Winzip applications under Windows. However, the zip commmand under Unix/Linux does not seem to archive files under sub-directories. If you use the Windows zip or Winzip application then use the file extension .zip for the archive file and it is your responsibility to ensure that all the files are correctly archived.
> firefox &Why do this?
If you do not type the '&' the console window will be 'stuck', waiting for you to quit netscape, before it will display a prompt for the next command.
> man program_name > man ls - will tell you about the ls commandIf you don't know the name of a command you can try looking for manual entries via a keyword
> man -k keyword This will list all programs that man thinks might
be relevant to your keyword (often more than you want)
eg. try
> man -k print
>matlab & (I suggest you run it in background)a large window will pop up (eventually!). This will contain 3 sub-windows; a command window, a command history window and a launch pad window.
The launch pad window allows you to browse and launch existing MATLAB programs by double clicking on them rather than typing their names into the command window. The command history window records all your commands, previous commands can be edited and reused by double clicking on them. However, previous commands are always accessible to you from the command window via the arrow keys or (Control-P).
I practice I prefer to close the command history and launch pad windows, and only use the command window.
Many programs 'understand' common emacs command for modifying text. For example, Netscape, the console window, and the MATLAB command window will respond to basic emacs commands.
For example to create and edit a file called script1.m you would type the following command in an console window
> emacs script1.m & ( run emacs in background)In the emacs window you can then type in a simple MATLAB script. To save your program select 'Save Buffer' under the 'Files' menu. (You can also save the file by typing Control-x-s, that is type x and s while holding the control key down)
For more information on how to use emacs you can select 'Emacs Tutorial' from the 'Help' menu. It will take you about 15 minutes to run through the tutorial.
When you type in a program, save it, and then try to run it in MATLAB you will inevitably have an error. You will get a message giving the line number in the file where the error occured. To fix the problem go to your emacs window and edit the file. There is a shorthand way to get to a desired line, type Esc g. At the bottom of the emacs window you will be prompted for the line to go to - go there and fix your error(s). Save the corrected file (Control-x-s). Move to the console window running MATLAB and try again...
Go to the Vision Course How To page to see how you can configure emacs so that it recognises MATLAB files and performs appropriate syntax highlighting.
Experiment, have fun...
Don't forget to log out