Command-Line versus Graphical Interface


History, or at least folklore, tells us that Apple’s GUI (graphical user interface) development arose from a visit to Xerox PARC (Palo Alto Research Center). Apple executives, including Steve Jobs, were impressed with the fledgling foray into a new user experience — the graphical user interface that was implemented on the Xerox Star and Alto workstations. Until that time, the developing personal computer industry was dominated by operating systems and applications directed solely from the keyboard. Pointing devices, such as mice, were virtually unheard of, although some games supported joysticks as optional control devices.

Apple’s Lisa was the first consumer line to be introduced with a GUI, but at $10,000 each, a small software base, and limited (and proprietary) development tools, this machine was soon eclipsed by another Apple product, introduced a year later — the Macintosh. From the beginning, traditionalists decried the Mac and its GUI as a toy and opined that “real computer users use the command line.” Thus began a religious argument that still flares up today, albeit with slightly less heat and frequency, concerning the relative advantages and disadvantages of the two approaches. The evolution, by Microsoft, from DOS to Windows dragged all but the most vocal opponents of GUIs into the current era, and the advent of windowing systems for Unix has quieted most of the rest.

Whether it is easier to select a desired folder from a Window menu, navigate a file browser to locate it, or type cd directoryname depends greatly upon the context, the user’s typing ability, and the user’s memory.

Note

What we visualize as folders in our graphical interface are generally referred to as directories in a Unix (or almost any other command-line) operating system. Throughout this Chapter, we use folder when talking about the GUI view and directory when dealing with the Command Line Interface or CLI.

The traditional Unix interface is a CLI, although all modern Unix distributions provide GUIs. These GUIs include an assortment of window managers running under the X Window System or X Windows for short. X Windows is a windowing environment for Unix that allows multiple windows on the desktop, much like one would find on any current OS. In fact, most popular window managers enable multiple desktops, a feature which is made available to Mac OS X by means of third-party software, such as CodeTek VirtualDesktop, which is discussed in Chapter 22, or Desktop Manager available at http://wsmanager.sourceforge.net/

Note

Apple bundles Xfree86, a freely redistributable open-source implementation of the X Windows System with Panther. Installing X Windows, or X11 as Apple refers to the software, is covered in Chapter 26

Almost without exception, anything that can be accomplished by using one interface is also possible with the other. One example of a CLI’s power is to delete all files with a particular extension by typing a single command. Using Finder in Mac OS X, you can launch Sherlock to find all names with the same extension and then drag the found items to the Trash. You achieve the same result by using a different method.

You access the Unix command line in Mac OS X by using the Terminal application (found in the Utilities folder of the Applications folder). The initial Terminal window is shown in Figure 24-1. The Terminal window presents a few clues, if you know how to read them:

click to expand
Figure 24-1: The Terminal window doesn’t give you many hints on how to proceed.

  • The path to your current directory (the Unix term for folder) is shown in square brackets to the left of the prompt. In Figure 24-1, localhost followed by the tilde (~) indicates that you are in your home directory on the machine, localhost.

  • The user ID (short name) of the current user follows — that’s you, most often.

  • The % or $ character at the end of the line indicates that you are not logged in as the System Administrator (the root user) and serves as your command prompt. Depending on the shell you are using, the prompt will be % or $. This is a quick way of identifying the lineage of your shell. C shell and tcsh use the % symbol. Bourne (sh) and Bash (Bourne-Again sh) use the $. If you’ve installed a fresh copy of Panther you’ll have bash as your default shell. If you’ve upgraded a previous version of Mac OS X to Panther then your default shell will be tcsh.

The command-line interpreter in Unix is called a shell. In the next section, we delve a little deeper into the default shell and the other shell choices available to you. Apple has had a shell, called MPW, available as part of a package for Macintosh programmers (and other users) since 1986 (and as a free download for almost a decade) called MPW. The MPW shell differs from the shells available in the Terminal mostly in the following ways:

  • The command names are different.

  • The wildcards used are different.

  • MPW Shell is also a full-featured text-editing environment.

  • A Unix shell can spawn processes and has more control due to Unix’s multitasking model.

Tip

Sometimes applications have options available from the command line that aren’t necessarily available through the GUI. For an example, open a Terminal window, type the word screencapture and press the Return key. Read the options for use of the screencapture command carefully, as they are much more extensive than the options that the Command-Shift-3 and Command-Shift-4 keyboard shortcuts allow you to use.




Mac OS X Bible, Panther Edition
Mac OS X Bible, Panther Edition
ISBN: 0764543997
EAN: 2147483647
Year: 2003
Pages: 290

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net