Introduction to UNIX in SEASIntroductionUNIX is a special kind of program called an operating system. An operating system is the interface between a computer user and the computer hardware. In the School of Engineering and Applied Sciences (SEAS), a large number of computer workstations and time sharing systems which use the UNIX operating system are used for education, research and administration. This tutorial is intended to help users make effective use of those computer systems. Most of what follows is intended to be general information which applies when using UNIX computer facilities in any department of the School of Engineering. In some cases, especially at the outset, some references are made to specific computers and resources in the Departments of Chemical, Electrical and Mechanical Engineering, and in the institute of Optics. ConventionsThroughout this document the following conventions will be used: Text appearing in the Helvetica Normal and Bold fonts, such as this, is instruction and narrative. Text appearing in the Courier font such as Text appearing in the Courier Italic font such as The symbols [RETURN] and [CR] both mean that you are to press the carriage return key on your keyboard. The symbol [ESCAPE] means that you are to press the escape (Esc) key on your keyboard.
Finding HelpIf there is a single most important point to be made by this document and tutorial, it‘s that help is available in the form of people and documentation. You may contact any member of the Computer and Networking Group by telephone, email, or by visiting their offices to ask questions or to discuss methods for getting work done on our computers. Additionally, user manuals are available in several locations, most notably in the computer laboratories.
School-wide (SEAS) SystemsThe primary system within the School of Engineering is NOVA (nova.seas.). This system provides for general interactive computing for all SEAS members, for academic (course-related) work and for research work. NOVA provides substantial file service for SEAS, and is the SEAS web server at this time. A second important SEAS system is SLEDGE. SLEDGE is a multiprocessor Sun system that is not intended for simple general computing (please don‘t read mail, news, etc. there). SLEDGE is a compute server for those large jobs that either needs lots of memory and/or will run for long periods of time (e.g., longer than about 30 minutes). Like NOVA, SLEDGE is available for all members of SEAS. SLEDGE will be retired from service before the end of 2001, as it is now quite old, and is far slower than any desktop system. HORNET is a new member of the SEAS computing cluster. HORNET is an Intel system running Linux (a version of UNIX). Linux provides a wealth of software, and performs quite well. All member of SEAS may use HORNET; do remember it is a shared resource, and thus one should not use an unfair amount of that resource. ESSEX is another new member of the central SEAS host cluster. ESSEX is a Sun Ultra running Solaris. It will be taking over many of Nova‘s duties, especially file and information serving. BILBO is the final member of the central SEAS cluster. BILBO is not intended for logins or computing - it provides our Usenet news service, and is already at the edge of its computational ability to handle that load. Now for the individual departments.. Electrical EngineeringIn ECE, the machines GALAXY and NEBULA are available as a general interactive servers. These machines are well suited for reading mail, and other tasks which are not computationally intense. While NEBULA currently provides the disk space used by the majority of ECE‘s users, this will change within the next few months (early-mid 2000). GALAXY is currently running under SunOS 4.1.3. NEBULA is a new system, running Solaris 2.5.1 (SunOS 5.5.1), and is faster than GALAXY. GALAXY may be upgraded or retired sometime in 2001-2002. ECE also provides a computing lab in CSB 527. That room contains fourteen Sun Ultra workstations running Solaris 8. This facility is available to all members of ECE, although you do need to obtain key-code access to the rooms, and courses have access priority. These systems are intended for academic coursework. They are not intended to be used as a bank of compute engines accessed remotely. They are intended to be used primarily by someone sitting at the console. ECE also has a dedicated mail server, known as VALHALLA. VALHALLA collects and distributes mail for ECE. Users are prohibited from directly using VALHALLA, since a heavy user load could seriously disrupt email (one doesn‘t need to login to VALHALLA to read ECE email, email is available on any ECE machine). VALHALLA was upgraded in early 2001. VALHALLA is also the file and information server for ECE. Finally, ECE has a web server, HENRY. This system is also known as WWW. Like VALAHALLA, HENRY is a service system and users are prohibited from logging in. Please remember to reference the ECE web server as ‘WWW‘ and not as ‘HENRY‘, as that service may be moved to another machine at anytime for performance or reliability reasons. HENRY is scheduled to be upgraded from a Sun LX running Solaris 2.5.1 to a Sun Ultra-1 running Solaris 8 by mid-autumn 2001. Mechanical EngineeringIn ME, the primary interactive and compute server is ISAAC, a Sun Ultra running Solaris 2.5.1. In addition to ISAAC, ME has a server FULCRUM. FULCRUM serves as a mail and web server for ME. In addition FULCRUM provides most of the disk space for ME users. Due to the number of tasks that FULCRUM is being asked to do, users are asked to stay off of FULCRUM. The GMLAB facility contains a number of Sun Ultra workstations; access is granted by the department for certain courses. It is not a general computing facility. Institute of OpticsOptics provides three UNIX machines named MOE, FINE and XRAY. MOE provides mail and file service for the Institute of Optics, and is available for general computing. FINE is a new Sun Ultra running Solaris 7.0, and is substantially faster than Moe. We strongly recommend using FINE rather than MOE for most interactive computing needs. XRAY (xray.optics., also known as www.optics.) is an Intel platform running Linux 7.0, and provides web service and anonymous ftp service for Optics. Chemical EngineeringChemical Engineering has a departmental UNIX machine, known as OZ. OZ serves as a mail server, file server, ftp server, and web server as well as a general purpose interactive session server. BioMedical EngineeringBioMedical Engineering (BME) is the newest department within SEAS. BME has a system, bionic.bme. which serves as their primary interative computing host. BME members are urged to transition from using Nova as their primary host to Bionic. Bionic may be used for reading email, news, general and scientific computation. It is much faster than Nova, has much more memory, and a much larger inventory of software. Accessing the facilitiesThere are five main ways in which you can access the computing facilities (i.e., in which you can get to a login: prompt). 1. Direct use of a workstation in one of the Computer Labs To use the computers in the workstation labs, simply sit down at a workstation in one of the labs. The screen will appear something like the following: SunOS UNIX (moe.optics.) login: The name of the computer will appear in the parentheses. Note this method is not very common anymore; most sytems have some type of graphical-user-interface (GUI) login screen.
2. Connecting from networked computers. In order to connect to one of the general interactive session computers (Bionic.bme, Galaxy.ece, Nebula.ece, Oz.che, Fine.optics, Moe.optics, Nova.seas, Isaac.me - or any appropriate UNIX host) via the campus wide area network, use a SecureShell (SSH) or RLOGIN program to connect to an appropriate host. TELNET is decprecated; it will soon be turned off on most SEAS UNIX hosts. But for historical reasons, here is an example of a telnet session: uhura-deke 10% telnet galaxy.ece. [RETURN] Trying 128.151.160.40 .......... Connected to galaxy.ece. Escape character is ‘^]‘. SunOS UNIX (galaxy.ece.) login: Users of personal computers, such as Macintosh or IBM PC compatible computers, often have a telnet application. By running this application, a connection to the desired host is established and a login: prompt is displayed. It is much better if you get one of the free SecureShell client programs and use that rather than Telnet. Many systems also provide for ‘rlogin‘ connectivity, which is a nicer connection than telnet. From another UNIX system, you would connect something like: 119% rlogin nebula.ece. Last login: Fri Jan 9 12:07:59 from dagger.ceas.roch Sun Microsystems Inc. SunOS 5.5.1 Generic May 1996 University of Rochester Department of Electrical Engineering ______________________________________________________________________________ 1% SecureShell logins are similar to RLOGIN, with the added benefit that the session is encrypted. Telnet and Rlogin allow other individuals to "sniff" (read on the network as it is transmitted) your password (or any sensitive text). SecureShell protects you (and us) from that. We strongly urge all users to convert to SecureShell conenctions. For more information, see our page on SecureSHell use in SEAS. 3. Access via a dial-up network connection (PPP or SLIP). Many individuals now make use of an ISP (Internet Service Provider) to give them an internet connection at home. This method of connection is similar to ‘2‘ above. The UR does not have a preferred vendor for ISP services; you may use any reasonable ISP. Unless you are also using use of VPN software configured to work within the UR‘s VPN setup, you may not have full access. Again, see ITS (274-HELP) for details. You may also wish to look at our email restrictions that are affected by this. In addition to those facilities physically located within the departments of the School of Engineering and Applied Sciences, Academic Technology Services (formerly the UR Computing Center) provides several terminal rooms, personal computer labs and workstation labs on the River Campus. These, too, may be used to access the computer facilities of the School of Engineering and Applied Sciences. One brief word on how to decide when to use a workstation as opposed to a terminal. A simple terminal session can be used for many types of computing activities, including reading mail or news, editing text files, and running virtually all standard UNIX utility programs. A graphics workstation is intended for those users that run programs requiring a window system environment. Such programs would include many of the Engineering CAD programs and word processing programs. Logging In and OutTo log in to UNIX computers there are three things that you need to know: user name, password, and terminal-type. USER NAME: This is your individual identification for the systems. This is most often your last name or a variation of it. All user names are lower case, as are almost all UNIX commands. PASSWORD: Your password is a secret set of characters that you must type in order to gain access to the computer. You should NEVER give out your password to anyone, including the systems administrator. TERMINAL-TYPE: The terminal type is name or designator for the type of terminal you are using. If you are using a terminal emulator computer program, like Versaterm or Kermit, check with the documentation on the program to determine the terminal emulation being used. In many cases, this setting is automatically determined by the host computer at login time - but not always. The following example shows a sample login session which makes use of this information: SunOS UNIX (oz.che.) login: kaser [RETURN] Password: MY_PASSWORD [RETURN] Last login: Thu Sep 19 14:17:58 from mac1 SunOS Release 4.1.3 (GENERIC) #1:Tue Mar 6 17:27:17 PST 1994 University of Rochester Department of Chemical Engineering _______________________________________________________ Please contact a member of the systems staff if you have questions or need assistance (send mail to "problem"). You are logged onto oz.che. On NIS domain URCHE, mail domain CHE.Rochester.EDU _______________________________________________________ You have new mail. TERM = (vt100) [RETURN] oz-kaser 1% Your password will not be displayed on the screen when you type it, so as to make sure that other users do not see it. The message that is given after you log in is called the MOTD or Message Of The Day. You should read this message every time you log in. The system staff uses the MOTD to keep users informed on important items like scheduled computer down time or temporarily unavailable services. In the example, "oz-kaser 1%" is what is called your prompt. Your user name will be displayed in place of kaser. The cursor is the point at which the next character typed will be placed. This is usually denoted by a block that may or may not be flashing. The next thing you need to know is how to log out of the computer. This is done by typing the word logout at a prompt, followed by [RETURN]. This ends your session on the computer. oz-kaser 1% logout [RETURN] Logged off Tue Sep 24 10:43:02 EDT 1994 This takes care of the basics of logging into and out of a UNIX computer. We do recommend an alternative method of logging into most of our systems. Most (but not all) UNIX systems in SEAS now provide Secure Shell service - this is a secure connection method, that provides an encrypted tunnel for your communications. Secure shell connections can be obtained by using the ‘slogin‘ command rather than the ‘rlogin‘ command (e.g. Secure shell clients are available for Windows (Win95/98/ME/NT/2K/XP) systems. We recommend one named ‘Putty‘. We are researching Secure Shell clients for MacOS. If you travel with a laptop, and need to connect to systems at the UR, or work from home, we strongly recommend the use of secure shell connections.
Each user of a UNIX computer system has a "home directory", which is a portion of the shared system disk in which that user can store files. In order to make effective use of your home directory, it is helpful to understand the basics of the UNIX file system layout.
For those familiar with the Macintosh, think of a UNIX directory as a folder on a Macintosh disk. Within that Macintosh folder there may be more folders, applications and documents. A UNIX directory, such as your home directory, is similar. It contains files, some of which may be programs or text files or even other directories. The following diagram represents a UNIX directory and a few files.
In this way, a UNIX directory is like an upside down tree. The "root" of the tree is at the top, and the branches of the tree extend downward. Every named point on the tree is a "file", but those files which can contain other files are "directories". In this example, the following are directories: etc, home, bin, deke, and kaser. The "root" is a directory too. The files "unix", "motd", "passwd", and "mbox" are not directories, because they are not able to contain other files.
The directories "deke" and "kaser" in this example are the home directories for the users of the same name. Note that within these home directories, the users "deke" and "kaser" have stored some files and directories.
Every file has a set of characteristics which include, among other things, its name, its ownership and the access permissions granted to individuals or groups of users.
A file on a UNIX system may be named with a string of alphabetic and numeric characters. Any mixture of upper and lower case is allowed. Characters not allowed in a file name, or which should for other reasons be avoided, include the [SPACE] character, and the following punctuation characters: Within a directory, no two files may have the exact same name.
Every file has an owner. In most cases, the owner is the user that created the file. The file also has an associated group, which identifies a group of users that may have some special access privileges to the file.
The permissions which are associated with a file grant read, write, and execute permission to the user (the owner), group and to others.
The permissions are represented as a string of characters, such as
If the first character is a "d", the file is a directory, and if the first character is a "-", then it is a plain file. the next 9 characters are the permissions. The first "rwx" grants read, write, and execute permissions to the user. The second three grant permissions to the group, and the third to other users.
Some examples:
Look back to the previous diagram representing a UNIX directory and a few files.
When the user "kaser" logs in, he starts out in his "home directory", which is also called "kaser". The "pwd" (Print Working Directory) command shows this.
Note that the full name (also called the absolute path name) of the home directory of user kaser is /home/systaff/kaser. This says that the directory "kaser" is within the directory "systaff", which is within the directory "home", which is below the root directory (called "/"). The mbox file within this directory, for example, has an absolute path name of /home/systaff/kaser/mbox.
The "ls" command lists files. The "-l" option causes the list to include additional information, such as ownership, permissions, size and the date and time of the last modification.
These commands and others will be discussed in the next section.
Note: is is very important that you store research project related material in directories/disks provided by that project, and not in your home directory.
The basic commands are those that you absolutely need to know in order to work within the UNIX environment. Commands are program names, like man, cat, mail, or ls. Arguments are additional things typed after a command that the program will use to affect its behavior. Command options are among the possible arguments.
A description of some of the basic commands, with examples, follows:
Useful options are -a and -l. The -a option lists all files in a directory including the "dot" or "hidden" files. The -l option lists a directory in long form, showing permissions, number of links, owner, size in bytes, and time of last modification for each file.
The passwd program allows users to set their login password. When changing a password, passwd prompts for the old password and then for the new one. You must supply both, and the new password must be typed twice to forestall mistakes. This can only be done on a departmental machine and not one of the School machines.
All user commands have manual pages that can be read on-line using the program man. One useful argument to man is the "-k" option. This option gives a list of commands or descriptions that match the keyword.
This command is used to determine your location in the file system.
Cat displays the contents of a file on the screen without any breaks for screen size. It is a good way to display short files.
More is another way to display the contents of a file on the screen. More will give you one screen‘s worth of information at a time. This is very useful for looking through long files. More scrolls up to display one more line in response to a [RETURN] - it displays another screenful in response to a [SPACE].
Once some files have been created, some additional commands can be used to remove, rename, or make a copy of a file.
To move or rename a file, use the move command, mv. To copy a file you can use the copy command, cp. The rm command can be used to remove or delete a file.
These commands will help in the organization of your files.
Remembering the UNIX file structure that was discussed earlier, we can make directories or folders so that the organization of files is easily remembered. To create a directory use the command mkdir dir-name. Once you have created a directory you can move files into it. To remove an empty directory you can use the command rmdir dir-name.
Once you have created a new directory, you may want to change directories to make that sub directory your current working directory. To do this use the
Note the "/" after the listing in #3. This designates a directory so you can easily distinguish between files and directories. In #9 you will notice the command
Another widely used command is mail, the interface to the electronic mail system. As this topic is discussed in detail in the Email tutorial, it will be handled here in a very brief way.
To send mail, you‘ll first need to know the recipients email address. Within a department, or on a given computer, this is simply the user name or login name. To find out the user name for someone using their real name, use the command finger.
Once you know this information you are ready to send mail to that person using the mail command, as shown in the following example.
The Cc: line allows for a carbon copy to be sent to another user or to yourself. Just type the user name and then return. If more than one user is to get a carbon copy, separate the user names with a ",".
The mail command with no arguments allows for reading mail, as shown in the following example. Type the number of the message you want to read and then [RETURN]. This will display the message on the screen for you to read.
When you "quit" from mail, all undeleted mail will remain in your system mailbox.
This gives you the basics of the command mail. To obtain more information on this command, please see the tutorial notes on Electronic Mail.
Printing files from a UNIX computer is done by issuing the lpr command. This will print your file to the default printer.
To find out what printers are available from the computer you are logged in to, you can issue the command printers.
Prints to the default printer. To print to a printer other than the default, use lpr -Pprinter
Prints the printer named hpn-416.
You can expect the printed copy in a few minutes if the printer is not already busy printing other files.
To find out the status of your print request you can use the command lpq. The lpq commands tells you how many files are waiting in the print queue. Again to examine the queue of a printer that is not the default use lpq -Pprinter.
Printing should be done for final copies of files and not for proofing. If you printed a file and then realize that it was not the file you wanted to print use the lprm command to remove the print job from the queue.
The above message from the machine that the printer is connected to shows that the print job has been terminated. You can also use the same option when removing a print job from a printer that is not the default.
Files on a UNIX system are created in a variety of ways. Some files, such as your mbox, are created by a program that you run. Other times, you may wish to create a text file on your own, either from scratch or by modifying some existing file. In these cases, a text editor is called for. Vi is one of several available text editors, and will be discussed here briefly. For a more complete discussion of text editors, word processors and document formatting software, please see the tutorial on Editors and Formatters.
The vi editor operates in two basic modes: the text insertion mode (in which you type the characters you want to include in your file), and the command mode (in which you operate upon the text, by moving or deleting text).
When first started, the vi editor is in command mode. To enter the insert mode in order to begin typing your text, press the i key. At this point, anything you type will appear on the screen just as if you were using a typewriter. At the end of each line, just as on a typewriter, you should press the [RETURN] key. When you are through typing and want to return to command mode, press the [ESCAPE] key.
Once in command mode, the arrow keys on your keyboard can be used to move around the body of the text. If your keyboard does not have arrows, the following keys can be used to move the cursor:
Some other operations available in command mode:
To return to text insertion mode from command mode:
To return to command mode after any of these insert commands, press the [ESCAPE] key again. When you aren‘t sure of the current mode (command or insert), press the [ESCAPE] key to make certain that you are in the command mode.
When in command mode, some of the commands used to write the file to the disk are:
For more information on Vi, see the Vi section of the Editors and Formatters Tutorial, where you can also a more complete discussion of text editors, word processors and document formatting software, in general
For more advanced discussion of Unix, proceed to the Intermediate Unix Tutorial.
Prepared by John Simonson, Bob Kaser and Deke Kassabian
Last modifed: Friday, 18-Aug-2006 11:22:34 EDT |
|