The Shell

The Shell

A key Solaris concept is the functional separation between the user interface and the operating system. This distinction means that a user can access a Solaris system by using either a terminal-based character user interface (CUI) or a high-resolution graphical user interface (GUI) without modifying the underlying operating system.

With so much attention paid to GUI, why are CUI environments still important to Solaris? Are they just a historical hangover that Windows has managed to overcome? Or are they simply the tools of choice for long-haired network administrators who have never used a mouse? In fact, mastering the Solaris command line is one of the effective tools available under any UNIX environment, and the good news is it’s not that difficult to learn. Using the command line (or shell) has several advantages over GUI environments.

The shell is essential for programming repetitive tasks that can be performed laboriously through a GUI. For example, searching a file system for all document files that have changed each day and making a copy of all these files (with the extension .doc) to a backup directory (with the extension .bak) takes time.

The shell can be used to search for, modify, edit, and replace Solaris configuration files, which are typically storied in text format. This is much like the approach taken with Windows .ini configuration files, which were text-based. However, after Windows 95, Windows versions store configuration information in the Registry in a binary format, making it impossible to edit manually. All Solaris configuration files, including the startup scripts, are text-based.

The shell has a number of built-in commands that typically mirror those provided in the C programming language. This means that it is possible to write small programs as shell statements that are executed as sequential steps, without having to use a compiler (just like MS-DOS batch files are interpreted without requiring a compiler).

The shell can be used to launch applications that use a CUI, which is especially useful for logging onto a remote system and enabling access to the commands an administrator can use on the console, a valuable point in this era of global information systems. While Windows applications like Symantec’s pcAnywhere can be used for remote access to the Windows Desktop, they don’t easily support multiuser access (or multiuser access where one user requires a CUI and another a GUI).

The shell can be used to execute commands for which no equivalent GUI application exists. Although many operations could conceivably be performed using a GUI, it is usually easier to write a shell script than create a completely new GUI application.

Many applications in Solaris, Linux, and Windows are now available through a GUI interface. If you feel more comfortable using GUI interfaces, there is little reason to stop using them as long as you can find the tools to perform all of the tasks you need to undertake regularly, such as monitoring resource usage, setting process alarms and diagnostics, and/or remote access. However, if you want to make the most of Solaris and competently administer the system, you will need to become familiar with the shell and command-line utilities.

In keeping with the philosophy that different administrators have different needs and styles, Solaris makes several different shells available:

  • Bourne shell (sh) The original UNIX shell used to write all system scripts by convention.

  • Korn shell (ksh) Provides enhanced input/output features, including the print and read commands.

  • C shell (csh) Offers a command syntax similar to the C programming language.

  • The Cornell shell (tcsh) Includes improved terminal handling compared to the original C shell.

  • Bourne Again shell (bash) An open source, much improved version of the Bourne shell.

Exercise 2-1  Find out if these shells are installed on your system, and what others might be supported. Precompiled binary shells can be downloaded from

Part I: Solaris 9 Operating Environment, Exam I