Chapter 1: Introduction to the CSE UNIX Environment
Operating Environment
The computer facility you will be using is a group of servers running Unix (Solaris 8) and Dell Optiplex PC's running Microsoft Windows XP. In general, we'll assume that you're using a PC to access our systems.
The Microsoft Windows XP machines are all configured with a default software setup that allows students to access all the programs they need for class such as Eclipse, MS Visual Studio, MS Office, Java, etc.., All relevant programs can be seen either as desktop icons or located via the 'Start' button.
Our Unix (Solaris 8) environment is a little more complicated. The defaults allow students to access java, gcc, XEmacs as well as many other programs. However certain classes require different versions of programs. By default the sun jre is not the newest version but the operating system requires that version to be present. To give access a more up to date version of java you must use a command called 'subscribe'. A current list of what is on our systems and what can be accessed via subscribe is on our supported software page.
The Basics
Learning how to use the Unix (Solaris 8) computing environment will take some time. Fortunately, there is a lot of on-line help that will make this necessary process easy. First, you will need to learn how to interact with the window system. The default window system currently used by students is the X window system, using the Common Desktop Environment (CDE), a window manager and user environment that is found on most commercial UNIX vendors' machines. In addition, you will have to learn the UNIX operating system. Finally, you will have to learn to use an editor in order to create and modify files, including program files. The recommended editor is XEmacs (although other editors, such as pico, and vim are also available).
A few of the basic concepts behind our system may be unfamiliar to new users. An understanding of the these concepts is essential for working in the CSE computing environment.
Unix Client/Server Model
One program, called a client, sends a request to another program, called a server which satisfies the request. In our environment we use a software package called X-Win32 to connect to our Unix (Solaris 8) servers.Some of the terms that you'll hear in this environment might be unfamiliar. We'll consider these now.
- Client
- In this case X-Win32 acts as the client. It will display your UNIX desktop environment from the server in a window on your PC. All PC's in our labs have X-Win32 installed. X-Win32 is developed by www.starnet.com
- Login Server
- These are the computers to which you login. Although you're typing within a client window, those keystrokes are being sent to a login server, where they are interpreted, and appropriate responses are formulated and returned to your client. Login servers typically have many people using them at once; they are equipped with adequate memory and processing power for a large number of users. The operating system and programs are stored locally on the login servers but user's home directories and class data are stored on a central file server.
- File Server
- The file server is a large disk array that is designed for large scale use in terms of users and data storage size. Users do not login to the file server directly. They work on login servers, but when they request a particular file, such as their mailboxes, these come from the file server.
Disk Storage and the UNIX File System
Understanding the client/server model is critical to working effectively within the CSE user environment. It will enable you not only to find data you need to complete your assignments, but will also provide a key conceptual base for successful software development. If your programs do not take the thin-client/server model into account, you will run into problems in completing your assignments. Obviously, if the commands you write cannot find the appropriate data to process, or send the data through non-existent or poorly defined pathways, the program will not provide the output you want.
When your account is set up, you are given space on our filer where you will store your programs and data files. This is your home directory. You can look at your home directory to tell which server has been assigned to control your disk space. For example, if Alice has an account name of alice, her home directory might be /home/0/alice.
The name of the directories in a pathname are separated by the slash symbol, /. The only exception is the root directory, which is the topmost directory under which all other directories are stored. Instead of ``root,'' the file system assumes that any path beginning with a / should start in the root directory. Finally, the tilde character ~ can be used as a shortcut for getting to your home directory. Any user's home directory can be called as ~account-name; for example, user bob can refer to Alice's home directory as ~alice instead of /home/0/alice. In addition, tilde can be used by itself to refer to your own home directory; in other words, user Alice could refer to his own directory as alice, but could also refer to it simply as ~.

Figure 1.1: UNIX Filesystem Hierarchy
In figure 1.1 you can see that the directory /usr/class has been divided into two subdirectories, cse321 and cse459.31. Data files used by each of these courses will be found in each class's subdirectory. You can also see that user alice has disk space on the filer in /home. You should set up separate subdirectories for your labs and projects, as they are a very convenient way of organizing your disk storage. Subdirectories allow you to deal only with those files which are needed for the current task. This minimizes the chance you will become confused and change or even remove the wrong file. In addition, protection mechanisms are possible at various places along a path, and this provides for more efficient control of information.
Computer Windows
In computer terminology, a window is an area of a computer's screen that is associated with a particular program. An example can be seen in figure 1.2. Users interact with programs through windows, changing their locations on the display, and their sizes. More detailed information is available in Chapter 2.

Figure 1.2: A Window in CDE
Window systems also provide a convenient way for the user to work on several tasks at once. In a conventional terminal session, a user typically will need to quit one application before using another. Whilst this doesn't create a problem if the user has finished one project and is on to another, it can if the job at hand is a smaller, more interrupt-oriented task, such as checking email. Under window systems, using multiple applications simultaneously is very easy; each simply runs in its own window, independent of the rest. Window systems will be discussed in detail in chapter 2.
Using the Mouse
The mouse used with most of our clients is an optical mouse. The three buttons on the mouse serve different functions depending on the program you are running. Further, the buttons do different things in different windows. For example, the buttons serve different functions in an XEmacs window compared to an xterm window. Whenever the mouse pointer is clicked inside of the border of a window, that window becomes the active window. Anything you type is sent to the active window. If the mouse is not in a window, anything you type will be ignored.
The mouse is also used to display menus. To see how this works, move the mouse away from a window to the background of your screen. Press the right mouse button and a menu will pop up. That menu will be displayed as long as the mouse button is held down. To select a menu item, move the pointer down the menu so that the desired menu item is highlighted and release the mouse button. There are other things that can be done with the mouse and the mouse buttons but they will be discussed in chapter 2 which describes mouse functions and menu commands in more detail.
Getting Started in CDE
Now that you have a basic understanding of the systems and network you will be using, it is time to begin working with a login server. The CSE Department has a number of computer labs where you can log use this environment, enumerated in table 1.1.
You should go to one of these labs for your first session even if you plan to use the environment from remote.
Logging In
To Windows:
The first thing you should see is the Windows XP Logo (see figure-1). To login, momentarily press and hold the <ctrl>, <alt> and <delete> keys. If you see figure-2 first, then skip to the next step.

(figure-1)
The key combination will cause Windows to prompt you for your account information
(see figure-2). Click inside the ‘User name:’ box and type the username
that was provided to you.

(figure-2)
Then click inside the ‘Password:’ box (see figure-2) and type your
password. Your default password is the last four digits of your SSN followed
by the first initial of your first name, the first initial of your last name
and an “!”. (e.g. John Smith’s password would be 6789js!).
Note: Your password is all lower-case. Make sure that “CSE” has
been selected in the ‘Log on to:’ box then click on the ‘OK’
button to login. (see figure-2).
To UNIX:
You should have a login prompt noting which machine you are about to log in on. The prompt asks you for your user name (sometimes also called ``account name'', or ``login''). If you were using the machine named ``beta'', you would see a graphical box saying ``Welcome to host...''
At this point you should enter your user name at the login prompt and press Return. You will receive your user name in class the first week of the quarter. The system will then ask for your password. The passwords for new accounts are the last four digits of your student ID number followed by your first and last initials in lower-case letters. Your initial password will also be verified by your instructor during the first week of class. As you type your password, the system will not display what you are typing, so be sure to enter the information carefully. Once the password has been typed, press Return and wait for the system to validate your user name and password. If the system tells you that your user name or password is invalid, you have typed something incorrectly and should try again. If you are sure that you have properly entered your account name and password, see the operator in the lab and ask for help. (If you need to log out now before continuing, see the end of this document for details).
Changing Your UNIX Password
You will have to change your password the first time you login. While the simple system used for the initial login makes it easy to access your account, it also makes it relatively easy for someone else to get into your account. You will not be allowed to log in until you change your initial password to one that is more secure. If you fail to log in within the first two weeks of the quarter, your account will be deactivated. If at any time during the quarter you want to change your password again, move the mouse to the terminal window and type the command yppasswd and hit the Return key.
You will be asked to type your old password first. Then you will be asked to type the new password twice to ensure that you typed what you meant to type: remember, you're not seeing the password as you type it.
There is no way for you to retrieve your password should you forget it. To get your password reset you will have to go to the CSE Helpdesk. Be sure to bring your Buck ID as the helpdesk operators will not change your password unless they can verify you are who you say you are.
Your password should be six to eight alphanumeric characters. Do not use only numbers. A good password is a combination of upper and lower case letters, numbers and special characters. There are several ways to make a good password, including: using different punctuation symbols like, ``foo.bar'', ``my-name'', ``dog/cat''; or choosing a phrase and making your password the first letter of each word, like a password ``timuxp'' standing for ``This is my unix password.'' Do not use your first name, last name, middle name, mother's name, class name or any single English word. If your prized possession is a jeep, please do not make your password ``jeep'', as anyone who knows you will be able to guess it easily. You should change your password every month or so, and always change it immediately if you think someone has seen or guessed it. A password becomes less safe the longer you use it (if nothing else, it gives someone longer to guess it). The password file is regularly audited, and accounts with poorly chosen passwords will be locked out of the system. You will then need to go to the CSE Helpdesk and obtain assistance from a helpdesk operator. Once your account is re-opened, you will need to change your password to something more secure. Do not give your password to anyone or let anyone use your account. To do so can be considered academic misconduct and dealt with according to Ohio State University guidelines. If you have a legitimate need to share data files with another user, find out the correct way to do this from your instructor. Remember, you are responsible for anything done with your account. For more details on what constitutes academic misconduct on our machines, please see appendix C.
The OSU CSE X-Windows Environment
Once you have completed the login process, the X window system will be invoked. It may take a minute for the client to set up your screen, so be patient. When the client has set up all of your windows, your screen will look like the one shown below. The set of windows which appear on the screen when you logged in is the CSE default user environment. You should familiarize yourself with the purpose of each of the windows.
CDE Front Panel
CDE's front panel, pictured in figure 1.3 is the window at the bottom of the screen. It has a number of icons which we'll consider.

Figure 1.3: CSE CDE Front Panel
The Clock
The clock window displays the current time and date. Besides informing you of the time, this window can be used to determine if there is a problem with your machine. If the time does not change for several minutes, there may be a problem somewhere in the system. If you think there is a problem, contanct a CSE operator.
The Calendar
To the right of the clock is a calendar icon, which displays the current date. If you click on the calendar, the CDE calendar program will be initiated.Folders Subpanel
To the right of the clock is a subpanel, that is an icon with an arrow over it that will expand to a list if clicked. The list to which the "folders" subpanel will expand is shown in figure 1.4. As is true with icons on the front panel, when an icon in the subpanel is clicked, the corresponding program is started.

Figure 1.4: Folders Subpanel
Personal Applications Subpanel
To the right of the folders subpanel is a terminal icon. That subpanel will expand to list a number of applications, including XEmacs and a simple text editor. If the terminal icon itself is clicked, a terminal window, pictured in figure 1.5 will be started.

Figure 1.5: The CDE Terminal Window
Your terminal window is used for executing UNIX commands and running UNIX programs. When you want to enter a command or run a program, move the mouse cursor into the window and type the command at the prompt. For variants of the Berkeley C Shell (csh) the default prompt is a percentage sign (%). For variants of the Bourne Shell (sh), the default prompt is a dollar sign ($). When there is more text in your xterm window than will fit, the text at the top of the window is scrolled off of the window. The vertical bar on the right side of the window is a scroll bar. You use the scroll bar to see information which has scrolled off the top of the screen. Details on the use of the scroll bar and other X window features are in chapter 2 If you want to stop a program that is running, you can type control and c together (called ``control-C'', written as C-c throughout this document).
Mozilla Subpanel
``Mozilla'' is the codename of Netscape's web browser. The corresponding icon is that of ``Navigator'', Mozilla's more formal name. Clicking the Navigator icon will start a web browser. Clicking the ``mail'' or ``news'' icons in the Mozilla subpanel will start Mozilla's mail and news clients, respectively.
Center Section
Between the Mozilla and Printer icons is a section with four items of interest.
Padlock
The padlock icon can be found on the top-left part of the center section. Clicking it will lock your screen. This will cause the screen to blank. It will be necessary to enter your password again to resume your session. Do not lock clients in order to reserve them for future use; this should only be done when you're still working, but leaving the keyboard momentarily, i.e., to fetch a print job.
Desktop Buttons
By default, there are four desktops in CDE. Oddly enough, these are labeled ``One'', ``Two'', ``Three'', and ``Four''. Sometimes it is convenient to spread your work across multiple desktops. For example, you might be writing your program in one desktop and then in another, have the program running. Clicking on a desktop button will take you to the corresponding desktop. Double-clicking these will allow you to change their names to things that are more interesting and useful.
Busy Light
When a CDE action is running, i.e., just after you clicked the Netscape Navigator icon, you'll see the busy light flashing. The light will stop flashing once CDE has done its job and started the application, or finished whatever task you've given it to do.
Exit Sign
Clicking the exit button will initiate logout from CDE.
Printer Subpanel
On the right half of the front panel, there is a printer icon. The subpanel there is used for programs like the printer manager, which will show some of the printers that are available to you. The correct printer will be determined based on your client's location, so you needn't worry about this.
Style Manager
To the right of the printer is an icon of a mouse, some letters, and a bit of a window. This is the Style Manager, which is used for defining the look and feel of your environment. Starting Style Manager will present you with the window shown in figure 1.6, which will allow you to configure your environment to your tastes. The best way to determine which behavior works best for you is to try different settings. For example, do you like clicking in a window to make it active, or would you rather have any window with your pointer in it be active? The ``window'' option in Style Manager will let you choose which behavior your environment follows.

Figure 1.6: CDE Style Manager
Applications
Next is the Applications subpanel, under which you'll find ``Desktop Apps'', which has such things as ``Application Builder'' and ``Create Action'', tools for creating your own CDE applications and actions. Also, you'll find a file manager, system manual page viewer, and some other things.
Help
The icon picturing a question mark in front of a few books is the Help subpanel. There, you'll find detailed information about the help viewer itself, desktop information, the front panel, Sun's AnswerBook, and some information that's of specific interest to the local user community.
Trash
A wastebasket is pictured on the rightmost side of the front panel. Files can be dragged into the trash can from the File Manager to be deleted. You'll almost certainly find it easier to use rm, as explained later.
Logging Out
When you are ready to quit your computing session, you should log out of each interactive window before you are finished. That is, if you've got programs running in your terminal windows, quit them. If a web browser is running, quit it. If XEmacs is running, quit it. Terminal windows sitting at the prompt need not be quit before you logout of the system.
You can click the left mouse button on your background to bring up your Workspace Menu and select the last item, ``Log out'', from there. Or, you can click on the ``exit'' button on the front panel.
Remote Usage of the Environment
SSH
First off you need a SSH client. If you are using a Unix variant like Linux,
FreeBSD, or Solaris the client can be invoked by typing
ssh -X username@stdsun.cse.ohio-state.edu
into a terminal
window. You will then be prompted to enter your password and then you will see
a verification of your login. Below is a screenshot of what you should see.
The -X option allows ssh to tunnel X11 connections. This will allow you to run X11 gui programs like XEmacs. If you are using MS Windows you can download an open source ssh client like PuTTY to connect to our environment.
Querying X11 Sessions
If you have high-speed Internet connectivity and an X11 server on your machine at home, you can work on the stdsun machines just as if you were sitting in a lab or an office. This is done through the magic of the X Window System. Set your font server to use the host stdsun.cse.ohio-state.edu, TCP port 7100. If you want to login to the Sun (UNIX) environment, use the host stdsun.cse.ohio-state.edu.
A package that will provide a suitable X11 server on Micrsoft Windows is X-Win32. Free UNIX variants like Linux and FreeBSD will include X-org X11.
...from UNIX
For example, to start a new X11 session on a UNIX machine, using our environment here, you can use the command:
X -query stdsun.cse.ohio-state.edu -fp tcp/stdsun.cse.ohio-state.edu:7100
You'll be presented with a login screen; use your CSE login and password. NOTE: This information is not encrypted. If you are concerned about sensitive information being picked up by eavesdroppers on the network between you and the CSE department, don't use this method.
(You might want to use other options to specify alternate displays, or to exit X11 after logging out of the environment. See your man page for X for more details.)
...from Windows using X-Win32
This is a commercial product marketed by Starnet Communications. It is an X11 package that can be used with Windows 9x/2000/2003/XP. X-WIN32 can be downloaded from The Ohio State University Site Licensed Software website. This software is licensed for OSU students/faculty/staff use. In order to download this software you must use your name.n email address and password.
To configure X-WIN32:
- Go to http://osusls.osu.edu/upgrades/stg2wnx.html and obtain the software.
- Install the product on your machine by double-clicking the icon of the download.
- Once the product is installed run the XConfig
- To setup a session click ``Wizard'' under ``New Session''.
- Type in a name for the session in the ``Name'' field. This name can be anything you want.
- In the ``Type'' area select "ssh".
- In the ``Host'' field type stdsun.cse.ohio-state.edu.
- You will be prompted for a login and password. You may enter them now, or if you prefer you may leave them blank. You will be prompted to enter your login information when you connect. Click Next.
- You will now be asked for a command to be run upon successful connection. You
can do one of two things:
- Select "SunOS (Solaris)". This will fill in the appropriate command to open up an xterm window on connection. You can then run graphical applications from the command line and they will open in a separate window. For example, to run Xemacs, you would type xemacs &.
- If you prefer the desktop environment, you can enter /usr/dt/bin/Xsession &. While this will work, it will be very slow from outside the CSE network.
- Once you have clicked "Finish", select the session you just created and click "Edit"
Under the "Advanced" tab:
- If you selected "SunOS (Solaris)" in the previous step, change Window Mode to "Switch to Multiple".
- If you elected to use an Xsession, change Window Mode to "Switch to Single".
To open a session:
- Run X-Win32, the program icon will show up in your taskbar.
- Right-click on the icon.
- Go to ``Sessions'' and choose the session you just set up.
- Once the program has connected to a server it will bring up the CDE login screen. Login using your CSE username and password.
Using XEmacs
You can invoke the XEmacs text editor from the UNIX prompt to edit a file by entering the command emacs filename. Your terminal or PC screen will now behave as if you were in a XEmacs window. To get to a UNIX prompt, you can launch a shell from XEmacs with C-x !, or M-x shell.
Solving Problems with XEmacs
There are usually two types of problems remote users have with XEmacs.
- Cursor movement within XEmacs does not work correctly or the
screen does not refresh properly. Usually, this is a sign that you
are using the wrong terminal type. At the UNIX prompt, type echo
$TERMto see what the terminal type has been set to. If it is incorrect, you can change it with set TERM=newtermtype. If$TERMis correct and this is still happening, it could be that your communications software is not emulating that terminal type properly. Check the manual for your terminal emulator, to see if there are any other terminal types you could try to emulate. - You type XEmacs commands and the system ``hangs,'' never responding to anything you type. This is because you logged in through the UTS terminal server without specifying ``-'' after your domain name, or emacs after your host. subdomain. The control characters you are typing are being trapped by the UTS terminal server and never get to XEmacs; therefore, you get no response.
Lynx
Lynx is an ascii text Web-browser. It's fast, efficient, and easy to use. Type 'lynx' into a terminal window to use.