You can sit down at any of the Sun workstations in the lab; if the screen is dark, hit any key on the keyboard, and the screen should light up.
Never attempt to reboot, turn on, or turn off any of the equipment in the CS lab. If you have problems with the computers, contact Myron Kowalski (the MoCoSIN network administrator) or one of the CS faculty. Myron's office is 125 Collier, and his email address is myron@cs.moravian.edu. His job is to keep the network and computers running, though, not to help you design or debug programs...
All of the Sun workstations use the Unix operating system. Unix was developed in 1974 by Dennis Ritchie and Ken Thompson at Bell Laboratories. (Ritchie also designed and implemented the first version of the C programming language, a direct ancestor of Java.) One of the main goals of Unix (and C) is to provide a powerful, flexible, computing environment for people who spend a great deal of time using computers. Unix was designed to support many users with a reasonable level of security; in order for the system to know who you are (and thus what files and programs you can use), you must login by providing a username and password. If you have an account on the CIT computers, you will have a different username and password in the CS lab. Do not share your password with anyone.
The Suns use a graphical user interface (GUI) called the Common Desktop Environment (CDE), which is based on X Windows (developed at MIT). Once you enter a valid username and password, a variety of windows and icons will appear on the screen. Don't worry if they don't all make sense right away.
One of the windows may be a tutorial or introduction to the windowing system. If you don't see such a window, find the icon in the toolbar at the bottom of the screen that has books and a question mark. Click on the arrow above the icon, and you will see a a menu of choices. Click on "Desktop Introduction".
Follow the tutorial until you feel comfortable, and refer back to it in the future when you want to find out how to do something new. (If you have used other computers with graphical interfaces before, you may be able to go through this pretty quickly.)
If you have never used a web browser before, you should go through the Netscape Handbook, which can be accessed from the Netscape Help menu. You can save bookmarks in Netscape which point to web sites you'd like to go back to. Here are some interesting sites to explore:
search engine to find other sites Amazon Books bookstore with online book reviews MapBlast street maps for addresses in the US StockMaster current prices for stocks and mutual funds Vote Smart voting records for elected officials
By now you'll probably also have recognized a few familiar names among the computers. Since its inception, almost all of MoCoSIN's computer names have been taken from the Batman comics series.
There is one printer in the CS lab, and a few others scattered around the building. Each printer is labeled with its name; there are several different ways to print files, depending on the software you are using. By default, anything you print should go to the printer in the CS lab. Please get help if one of the printers doesn't work; we can't fix problems unless we know they exist.
You should use folders (also known as directories) to keep track of your files; for instance, you should have a folder for your Computer Science course, and separate folders within it for each homework assignment. It can be hard to keep track of everything if all of your files are in a single directory.
Start a shell window (also called a terminal window, since it is similar to old fashioned terminals) by holding down the menu button (on the right of the mouse), and select Terminal from one of the submenus. You should get a window with a scroll-bar, and a prompt of some sort - it will probably contain your name or the name of your machine. You can type commands at this prompt, and the results will (usually) be displayed in the same window. Note that you can open several different shell windows so that you can work on several different projects at once; large monitors are very useful for this purpose!
As a side note, be sure to check out MoCoSIN's Remote access page for instructions on how to access your MoCoSIN shell account from anywhere in the world!
The first, and perhaps most useful, Unix command you should know is man, which is used to find and display pages from the online reference manual.
Type man, and hit return; you should see a short usage message like this:
usage: man [-] [-adFlrt] [-M path] [-T macro-package ] [ -s section ] name ... man [-M path] -k keyword ... man [-M path] -f file ...Many (but not all) unix commands have such usage messages; the goal is to remind you how the command works, not to give you an exhaustive description. (Most users already know what the command does, and simply want a reminder of the syntactic details.) Thus you probably won't learn how to use man from the message.
Type man man and hit return; we'd like to see the manual page for the man command itself! Read through the man page for man briefly, but don't worry if you don't understand the details; most of them are for advanced users. At the bottom of the screen you'll see a line like this:
This indicates that you have seen about 6% of the man page; hit
the space key to see the next screenful of information, or type q
to quit this man page and return to the shell prompt.
Most Unix commands accept a series of optional arguments, possibly followed by one or more required arguments; the usage message puts square brackets around optional arguments. Optional arguments are often used to modify the default behavior of the program, so if you want a command to behave in a slightly different way, it's a good idea to check the man page for an appropriate option. The cd (change directory) and ls (list directory contents) commands (described below) will demonstrate this, and you can read their man pages to learn more about them.
Type passwd to change your password; the program will ask you to type your old password once (to prevent someone else from changing your password), and then ask you to type your new password twice (to make sure you haven't made a mistake in your new password). If you can't change your password, send email to Myron and include the exact error message (you should be able to copy and paste it from the shell window into your email message).
Type pwd (which stands for print working directory) to see what the current directory is.You should see something like /users/clif, which means that /, the root directory, contains a directory named /users, which contains a directory with your user name.
Type mkdir temp to make a new sub-directory called temp.You can use the File Manager to create directories, and do most of the other things described in this lab, but you should learn the shell commands too, since there are times when you'll need to use them instead.
Type cd temp to change the current directory to the new sub-directory (cd stands for change directory). Type pwd again to see the new working directory. There are several ways to get back to your home directory; you can type cd .. to go from any sub-directory to the enclosing directory, or you can type cd ~ to go directly to your home directory from anywhere else in the system.Use rmdir to remove unwanted directories, but please don't remove the temp directory yet, and be careful about removing directories if you don't know what's in them. (Feel free to ask about specific files or directories.) Unix prevents users from deleting directories or files that were created by other users, but you can create serious problems for yourself by removing directories or files in your home directory which are needed by other programs.
Go to your home directory, and use the ls command to print a list of files and directories in a particular directory. Depending on which tutorials you completed, and what else you've been doing with your account, there may be a variety of files in your home directory. If you type ls and nothing appears, there are probably no files in the directory.The ls command accepts an argument to specify that you want to list the files in another directory; type ls temp to see the contents of temp, for example. ls also accepts options to specify what sorts of information to display about each file, so that you can see how big the file is, when it was created, who can access it, etc; check the man page if you're curious...
Usually you will use a text editor to create files containing programs for homework assignments. You may use any text editor on the system, but the one called nedit is easy to use and includes some special features to help programmers. It can be started from the command line by typing nedit, and it may also appear in a menu.
Start a text editor, type something simple, like a favorite verse or quotation, and then save the contents as a file called test1 in your home directory. Don't create files with names that contain spaces (such as test 1) since you will trouble using them at the shell prompt. (Hopefully you are starting to feel comfortable enough to do this without explicit instructions; if you can't figure out what to do, ask for help.) Once you've saved the file you can close the text editor and return to the shell window.There should still be a file named test3 in your home directory, plus whatever other files you've created there in the past.If you type ls now, you should see the file you just created. Use the mv command to move a file (or to change it's name); thus you would type mv test1 test2 to rename your file test2. Similarly, use the cp command to copy test2 to test3. Finally, type rm test2 to remove test2.
CommandWhat it does cdchange the current working directory cpcopy a file gradelist or turn in an assignment lslist files manlook up topic in online manual mkdirmake a new directory (or folder) mvmove a file passwdchange your password pwdprint working (current) directory rmremove a file rmdirremove a directory
To use the Netscape mail program, you need to change your default email address. Go to the Edit menu in Netscape and select Preferences. Click on the triangle next to Mail & Newsgroups, and then click on Identity. Add "@cs.moravian.edu" to your user name in the field labeled Email address. For example, if your username is someuser, your email address will be someuser@cs.moravian.edu. Leave the Reply-to address field empty.
Of course, the Netscape program can't be accessed remotely, so if you plan to use your shell account from somewhere else, you should check out the pine program, which is an easy and fast way to read mail remotely.
This page was written by Clif Kussmaul, and is now maintained by Myron Kowalski, myron@cs.moravian.edu.