A Brief Introduction to Working in Solaris
As mentioned before, Solaris is not too different from Windows or MacOS on the surface, but there are some fundamentals you will need to know before you can get around in it easily.
First, Solaris is based on a long-standing command-line interface called UNIX. Originally, anything you wanted to do in UNIX, whether it be writing a paper or compiling a program, had to be done by typing commands into a terminal. Today, there are quite a few desktop systems based on UNIX that have a point-and-click interface so that not all commands have to be typed. The Solaris operating system used on ECN's Sun machines is one such system. However, it is important to realize that even this mouse-based interface is based upon the old UNIX commands, so some tasks will not be intuitive to a new user.
As an example, I will walk you through the process of creating a new text file, saving that file to your home directory, closing the file, and finally finding the file again and reopening it.
Creating a Text File
- To start a new text document, you need to open up a text editor. In Windows, you might use Notepad. In MacOS you could use SimpleText. In Solaris the program is called simply "Text Editor". To open the text editor, locate the picture of a pencil on a notecard on the toolbar at the bottom of the screen. Click the arrow above that picture and click on "text editor" in the menu that pops up.
- The text editor is much like any other text editor you may have used. Like Notepad, you cannot change font size or style. You can only print plain text. Start typing in the editor to create any text you want.
- To save your file, choose the "File" menu and click "Save". This is the step where some knowledge of UNIX is helpful. The "Save" window has a lot of confusing things in it, and here I will attempt to explain them.
At the top of the window, there will be a string of text that says something like: /home/pier/c/username/ Yours may be different, but it should still start with "/home/" and end in your username. This is the UNIX way of displaying what folder you are currently in. In the case of this example, the path shows that I am in a folder called "username", which is in a folder called "c", which is in a folder called "pier", which is in a folder called "home". Each slash represents a level of folder hierarchy. The fact that the last folder listed is "username" means that you are currently in your home directory. This list of folders separated by slashes is called a "path". The path will change as you navigate through folders using the other sections of the "Save" window.
On the left side of the screen is a field called "Filter" with some odd characters in it. You can ignore this field. Below it is a list of folders within the current directory. In Windows, folders and files can be told apart by their icons. In most Solaris programs, the "Save" and "Open" dialogues do not use icons. Consequently, the folders and files are split into separate lists. The folders are arranged in alphabetical order, but all of the capitalized names are displayed together followed by all of the lower-case names. Double-clicking on a folder name will move you to that folder. You may have no folders in your home directory yet, but you will have at least two entries in the "folders" list: "." and "..". You can almost always ignore ".", but ".." is very imporant. ".." is UNIX language (and DOS too) for "up one directory". Don't do it now, but if I were to double-click on ".." from within my example home directory, I would move up to the directory called "c" (I can tell this by looking at the path at the top of the window). For now, you want to stay in your home directory, so don't double click anything.
On the right side of the window is a list of all of the files in your directory. Since you have not created any files yet, the list might be blank, or it might contain a few system-related files. Like the folder list, the files are listed in alphabetical order with all capitalized file names listed first. For now, you are saving a brand new file, so it doesn't matter what files are already in the current folder.
At the bottom of the window is a field to enter a file name. This is where you name the text file that you are going to save. Here is another place where it is good to understand a little bit about UNIX.
UNIX does not understand files with spaces in their names, so do not put any spaces in your file names. If the name is more than one word long, for example "practice text file", you can try separating the words with underscores (practice_text_File) or with capitalization (practiceTextFile).
Second, you need to add the file extension manually. If you have used Windows before, you probably noticed that all files have a three- or four-letter file "extension." Some common examples are ".txt", ".doc", ".jpg", ".gif", and ".html". These extensions tell the system what type of file any given file is. In Windows, any program that you save from will automatically put an extension at the end of the file name. For example, whenever you save a document in Microsoft Word, the extension ".doc" is added to tell the computer that Microsoft Word should be used to open that file next time. Solaris uses file extensions too, but a lot of programs will not add them automatically, especially text editors. If you want to be able to open a text document on other operating systems (and you probably will), you need to add the proper extensions yourself. In this case, you want the file to be a plain text file, so you want to use the extension ".txt".
- Name your file "practice.txt" and click OK.
Now that you have saved your file, you will want to be able to open it again, and to do that you will have to be able to find it. The next part of this tutorial will show you how to navigate through Solaris to find files.