Overview
This chapter discusses the history, the main components, and the capabilities of the UNIX operating system. There is a review of operating systems in general, and a comparison of UNIX to other types of operating systems. This chapter introduces the Sun Microsystems version of the UNIX operating system, known as the Solaris Operating Environment or Solaris. An overview of the Linux operating system, which is based on UNIX, is also provided. Most of the information presented here is applicable to all varieties of UNIX including Linux.

 

1.1 Main Components of a Computer
1.1.1 Main computer components
The four main components of a computer are the central-processing unit (CPU), random-access memory (RAM), Input/Output (I/O) devices, and the hard disk or other mass storage devices.

CPU 

The CPU is the computer logic microprocessor chip that processes instructions that are received from the primary computer memory (RAM). These instructions are stored in binary language. The CPU typically plugs into the motherboard of the computer. Modern CPUs have cache memory on board to speed up operation. Examples of CPUs include the proprietary Sun Ultra SPARC (Scaleable Processor Architecture), which is designed strictly for the Sun line of workstations and servers. The following is a list of better-known CPUs designed for microcomputers: 

  • Intel x86, Pentium, Celeron, and Itanium 
  • AMD K6 series, Athlon, and Duron 
  • Power PC (PPC), which is a joint venture by Apple, IBM and Motorola 
  • Motorola 68000 Series 
  • Compaq (formerly DEC) Alpha

RAM 

RAM is physical memory in the form of microchips. It is normally located on either the motherboard or the memory board of the computer. It is the main computer memory, often referred to as primary memory or working memory. Primary memory is the part of memory in which the activity of the running system takes place. The phrase, "The system has 128 MB (megabytes) of memory", is referring to primary memory (RAM). Operating systems and software programs usually reside on the hard disk. When the computer is booted, an image or copy of the operating system is loaded into RAM. When a program is started, an image or copy of that program is loaded into RAM. Images in RAM remain as long as they are needed. When these images are no longer required, they are overwritten by other images. If power is lost or the system is rebooted, images in RAM disappear. RAM is available in many different form factors and performance levels. It is common to add RAM in computers to increase the size of programs they can run and also to improve performance.

I/O Devices 

The I/O portion of the computer accepts or reads input from a device into memory, or it writes output from memory to a device. There are many types of I/O devices. For example, the keyboard and the mouse are the primary user input devices. The monitor and the printer are the primary output devices. Disk drives and tape drives are considered both input and output because they can be read from as well as written to. A normal CD-ROM drive is an input device, but a CD-R (recordable) and CD-RW (read/write) are considered both input and output devices. A monitor can also be an input device if it has a touch screen.

Hard Disks and Other Forms of Mass Storage 

The hard disk is a magnetic storage device in which information is stored. All files, including the operating system and applications or utilities, are stored on a hard disk. The contents of the hard disk are managed by the file system, which will be covered later. Forms of optical storage, such as CD-ROMs, DVDs, and CD-Rs, are becoming standard components on many new computers. Tape drives are also very common as a backup device used primarily on high-end workstations and servers.

Disk drives typically communicate with the computer using Enhanced Integrated Drive Electronics (EIDE) or Small Computer Systems Interface (SCSI). CD-ROMs and tape drives typically connect using the AT Attachment Packet Interface (ATAPI), which is an extension to EIDE. ATAPI, EIDE, and SCSI are industry standards that are widely supported on all modern OSs.

 

1.1 The Components of a Computer
1.1.2 Peripheral components
Peripheral components are those that are independent of the CPU, RAM, and Mass storage. Some of the more common peripherals are discussed here. These include I/O devices and other components such as video hardware, audio hardware, and networking devices found in most modern computers. 

Keyboard and Mouse 

As previously mentioned the keyboard and mouse are the primary input devices. The keyboard and mouse typically interface to the computer using either a PS/2 or universal serial bus (USB) connection. USB is becoming more common.

Video Components 

The primary video components are the video adapter and the monitor. The video adapter provides the ability to display text and graphics. The amount of video memory determines the resolution and number of colors that can be displayed. Video cards are installed in an Accelerated Graphics Port (AGP) slot, Peripheral Components Interface (PCI) slot or can be built into the motherboard. Most modern PC's use an AGP interface for video. Monitors are characterized by screen size, resolution capabilities, refresh rate, and display precision known as dot pitch. The monitor connects to the video card using a 15-pin RGB connector. Flat panel LCD displays are becoming increasingly popular. Video components can also include motion video capture and editing systems.

Audio Components 

Audio usually includes a sound card and speakers. In some cases, audio includes a microphone. Sound cards typically use an Industry Standard Architecture (ISA) or PCI slot on the motherboard. The microphone can be separate or built into the monitor. In either case, it plugs into the sound card. Multimedia, music, and voice recognition applications take advantage of the sound components.

Printing Devices and Scanners 

Printing devices are output-only and include printers and plotters. There are hundreds of different kinds of printers and they can be attached to a workstation, a server, or directly to a network. Plotters are less common than printers and are primarily used for large-scale drawings. Printing devices can be attached to the computer using various interfaces such as parallel, serial, USB, and IEEE 1394 (FireWire).

Networking Components 

Many computers today come with an Ethernet network interface card (NIC) or adapter. This adapter allows computers to communicate with each other through a central hub device using a cabled or wireless connection. This connection forms a local area network (LAN). Most newer network adapters plug into a PCI slot on the motherboard. Older network adapters use the ISA interface. Modems are also considered networking devices, which allow remote dial-up to private networks and Internet Service Providers (ISPs). Modems can be either internal or external.

 

1.2 Computer Roles and Operating Systems
1.2.1 Desktop OSs, PCs, and workstations
Single User Desktop Systems 

All computers require an operating system (OS) to manage their functions. This is true regardless of the manufacturer of the computer or whether it is a microcomputer, midrange computer, or mainframe computer. OSs can be divided into two major categories: single user (desktop) and multiuser (network). Early desktop operating systems were single-user systems. This means that they could track only one user at a time and were designed to run on a Personal Computer (PC) desktop or laptop. DOS and Windows 3.x are examples of true single-user desktop operating systems. The activities of only one user can be managed; so only one user can be logged in at a time. Modern operating systems such as Windows 9x, NT Workstation, Windows 2000 Professional, Windows XP, and Mac OS have some networking capabilities for peer-to-peer workgroup networking. However, they are largely employed as single-user desktop operating systems.

Workstation and Desktop Applications 

UNIX can serve as a desktop operating system, but is most commonly found on high-end computers known as UNIX workstations. Sun Microsystems Ultra and SunBlade line of workstations are UNIX workstations that have powerful CPUs and ample memory. These workstations are employed in engineering and scientific applications, which require dedicated high-performance computers. Some of the specific applications that are frequently run on UNIX workstations are included in the following list: 

  • Computer-aided design (CAD) 
  • Electronic circuit design 
  • Weather data analysis 
  • Computer graphics animation 
  • Medical equipment management 
  • Telecommunications equipment management 

Most current desktop operating systems include networking capabilities and support multi-user access. For this reason, it is becoming more common to classify computers and operating systems based on the types of applications they run. This classification is based on the role or function that the computer plays, such as workstation or server. Typical UNIX desktop or low-end workstation applications might include word processing, spreadsheets, and financial management. On high-end UNIX workstations, the applications might include graphical design or equipment management and others as listed above.

The UNIX operating system can run on a personal computer. Any system that is running UNIX is referred to as either a workstation or a server. A PC is a system running any of the other popular operating systems originally designed for the PC.

 

1.2 Computer Roles and Operating Systems
1.2.2 Network operating system capabilities
All versions of UNIX and most other modern network operating systems (NOS) support advanced features: 
  • Multiuser capability 
  • Multitasking 
  • Distributed processing 
  • High level of security 

Multiuser capability enables more than one user to access the same resources and provides support for many users simultaneously. The OS keeps track of each resource, such as CPU, RAM, hard disk, and printers, and allows them all to be shared. Each program or application that runs is referred to as a task or process. Multitasking enables the OS to keep track of multiple processes simultaneously. This allows more than one tool or application to be used at one time. Distributed processing enables the use of resources across the network. For example, a user at a workstation would be able to access files and applications on the hard disk of another computer, or a printer, located on a remote part of the network.

Network operating systems are also very secure.  Beyond the basic username/password security there are many other security features. These features can be turned on or off, depending on the function of the system and the level of security the user or administrator desires.

 

1.2 Computer Roles and Operating Systems
1.2.3 Servers and the network environment

Network operating systems (NOS) have additional network management tools and features that are designed to support access by large numbers of simultaneous users. On all but the smallest networks, NOSs are installed on powerful servers or central host systems. The focus is on server-based or host-based NOSs. Servers are powerful computers that run a NOS and applications. Many users, known as clients, share these servers. Servers usually have high-capacity/high-speed disk drives, large amounts of RAM, high-speed NICs, and in some cases multiple CPUs.

Server applications and functions include Web services using hypertext transfer protocol (HTTP), File Transfer Protocol (FTP), and Domain Name Server (DNS). Standard E-mail protocols supported by network servers include Simple Mail Transfer Protocol (SMTP), Post Office Protocol (POP3), and Internet Messaging Access Protocol (IMAP). File sharing protocols include Sun Network File System (NFS) and Microsoft Server Message Block (SMB). Network servers, in conjunction with file services, also frequently provide print services. The UNIX print server is Line Printer Daemon (LPD). A Server may also provide the Dynamic Host Control Protocol (DHCP), which automatically allocates IP addresses to client computers. In addition to running services for the clients on the network, servers can be set to act as a basic firewall for the network. This is accomplished using Proxy or Network Address Translation (NAT), both of which hide internal private network addresses from the Internet. Server applications such as these are not normally implemented on a home desktop or LAN workstation.

Interactive Media Activity (Flash, 24 kB)
  Server Functions and Protocols

In this media activity, place a check in the box for each protocol that corresponds to the description on the left.

 

1.2 Computer Roles and Operating Systems
1.2.4 The OS and CPU relationship
Most OSs, in general, are designed to work with the CPUs of a particular manufacturer. Some can run on CPUs from different manufacturers, and some can support multiple CPUs of the same type. The various Windows operating systems (9x/ME/NT/2000/XP) run primarily on Intel-based CPUs. Solaris and Linux run on several different manufacturers CPUs including Intel. Server versions of the Windows OSs (NT and 2000) support multiple CPUs, as do most versions of UNIX including Solaris and Linux.

OSs and CPUs often are classified based on the number of bits they can manipulate. The more bits they can manipulate, the more powerful the CPU and the OS are. Most early NOSs and CPUs were 16-bit. Most modern NOSs and CPUs are 32-bit, with some being 64-bit. The Intel x86 CPU architecture is 32-bit and the Intel Itanium, or IA-64 architecture, is 64-bit. Sun Systems SPARC CPU is 32-bit and the Ultra-SPARC is 64-bit.

Examples of NOSs include UNIX, Windows NT/2000 Server, Novell NetWare, and various mainframe NOSs. Mainframe NOSs include Digital Equipment VMS, Hewlett-Packard MPE, IBM MVS, and several varieties of UNIX. Solaris or SunOS is the Sun Microsystems version of UNIX. A Sun workstation or server normally comes with Solaris, but can also be ordered with Linux. It is possible to order Intel-based servers with Windows 2000, Novell NetWare, or Linux pre-installed.

Although UNIX is used frequently as a workstation OS for high-performance applications, it is not generally considered an end-user desktop OS. It is most often used as a NOS on servers, and is often used with Internet Web servers. Linux can be used as a server or a high-end workstation, and is becoming increasingly popular as a desktop operating system for home or office use.

 

1.2 Computer Roles and Operating Systems
1.2.5 Operating systems, hardware, and drivers
Operating systems such as Windows 2000, Solaris, and Linux interact with computer hardware through the use of device drivers. A driver is a piece of software written for a particular operating system that allows the system to control a particular hardware device properly. Nearly all major computer components and peripherals, such as keyboards, mice, monitors, printers, scanners, and disk drives, require a driver to operate. Most operating systems come with basic drivers for the most common types of hardware and peripherals.

Solaris and Drivers 

The original Sun operating system, based on UNIX, was designed to run on computers manufactured by Sun Microsystems. The Sun operating system comes pre-installed on a consistent and stable hardware platform. This allows for maximum compatibility between the OS, the drivers, and the hardware. Solaris for Intel is designed to run on Intel-compatible (x86) computers, with a considerable variety of hardware, and with many different peripheral manufacturers. Either the operating system or the hardware manufacturer provides drivers. Drivers may not be available for all types of peripheral hardware.

Linux and Drivers 

Linux was also developed to run on Intel-based computers. The OS may not support some types of hardware, especially the latest peripherals. Linux, in the Intel-compatible environment, supports most CPUs including Intel and AMD, most types of RAM, and standard mass storage interfaces such as EIDE, ATAPI, and SCSI. Standard USB and PS/2 keyboards and mice are also well supported. Other USB devices may not be and will need to be checked. Most video card chip sets that are compatible with the XFree86 graphics system, which comes with Linux, are not a problem. However, the latest technology devices may not have drivers available yet. Network interface cards and modems are generally well supported, except for some internal modems that may require a special driver.

 

1.3 Overview of the UNIX Operating System
1.3.1 Brief history of UNIX
In the mid-1960s, the UNIX operating system was developed at AT&T Bell Labs with involvement from General Electric and the Massachusetts Institute of Technology. UNIX was developed as a multi-user operating system called Multiplexed Information and Computing Service (Multics). Multics was an interactive operating system written for a specific General Electric computer. After several years of development, Multics proved to be too expensive and Bell Labs withdrew from the project. 

Ken Thompson, a Multics programmer at Bell Labs, wrote a space travel game for the GE computer before the Multics project lost funding. With the help of another programmer, Dennis Ritchie, he rewrote the game to run on a Digital Equipment Corporation (DEC) PDP-7 computer that had a better graphics display. The DEC computer was great for running the space travel game, but it lacked a viable OS. In 1969, Thompson got the urge to develop his own OS. Originally, Thompson called the new OS that he had developed, with a colleague, Uniplexed Information and Computing Service (UNICS). The name was eventually changed to UNIX. The space travel game later was modified to run under UNIX. 

UNIX was first written in assembly language, a primitive set of instructions that control the internal instructions of the computer. However, UNIX could only run on a specific computer. In 1971, Ritchie created the C language. In 1973, he and Thompson rewrote the UNIX system programs in C language. Because C is a higher-level language, UNIX could be moved (or ported) to another computer with far less programming effort. The decision to develop this portable operating system proved to be the key to the success of UNIX. 

The early UNIX source code was made available to universities all over the United States. Programmers at the University of California at Berkeley made significant modifications to the original source code and called it Berkeley Software Distribution (BSD) UNIX. They sent this new version of the UNIX environment to other programmers around the United States. These programmers added tools and code as they saw fit. Possibly the most important advance made to the software by the programmers at Berkeley, was the addition of networking software. The networking software allowed the OS to function in a local-area network (LAN). BSD UNIX became popular with computer manufacturers such as Hewlett-Packard, Digital Equipment Corporation, and Sun Microsystems. 

The Sun Microsystems original version of UNIX, the Sun operating system (SunOS) was based on BSD UNIX Version 4.2. At that time, the AT&T version of the UNIX environment was known as System V (system 5). The Microsoft version of UNIX, developed for PCs with Intel processors, was known as XENIX. In 1988, Sun OS/BSD, AT&T System V Release 3, and XENIX were combined into what became System V Release 4 (SVR4). This new generation of the OS was an effort to combine the best features of both BSD and AT&T UNIX, to create an industry standard for the OS. This enabled software to be developed for UNIX without consideration for whether it was System V or BSD 4.2. The new SVR4 became the basis for most of the current varieties of UNIX. The timeline shown in the Figure lists some of the major events in the evolution of the UNIX OS.

The Open Group (www.opengroup.org) currently owns the UNIX standard and now guides UNIX development using a set of standard operating interfaces called POSIX (Portable Operating System Interface) and the Single UNIX Specification with the goal of increasing the compatibility of the UNIX operating system between vendors.

 

1.3 Overview of the UNIX Operating System
1.3.2 UNIX varieties
The two main versions of UNIX are System V (SVR4) and BSD. Currently, a number of varieties of UNIX exist. Most are similar because they are based on the industry standard SVR4. The other varieties are based on BSD. The command used for printing indicates whether the version of UNIX is System V-based or BSD-based. The command used for System V-based systems is lp and the command used for BSD-based systems is lpr. The command used to determine what processes are running is also an indicator. System V uses ps -ef and BSD uses ps -aux. Other differences exist with system administration commands. 

UNIX is now a trademarked name owned by The Open Group, so each vendor called its version of UNIX by a unique name. Sun's version of UNIX is called Solaris and is the most widely used version in networking today. The AT&T version is referred to as UNIX, the IBM version is AIX, and the Hewlett-Packard version is HP-UX. Digital Equipment, which is now Compaq, has a version called Tru64 that was formerly called Digital Unix. These versions of UNIX are designed to run on the hardware and CPUs made by the specific vendor. Solaris runs not only on Sun computers, but also on Intel-based machines. Linux, another version of UNIX that is becoming increasingly popular, also runs on different CPUs. By learning any one of these UNIX varieties, it is fairly easy to move to one of the others. The Figure shows some of the CPU manufacturers, and the various UNIX versions and operating systems that they can run.

 

1.3 Overview of the UNIX Operating System
1.3.3 Overview of Linux
The latest version of UNIX to emerge is called Linux. Linux was developed in 1991 by Linus Torvalds at the University of Helsinki, Finland. Torvalds posted it on the Internet and encouraged others to contribute to its development. It has features from both SVR4 and BSD. Linux has become very popular among computer enthusiasts, those looking for an alternative to traditional PC operating systems, and companies looking for a stable, low-cost OS. The icon for Linux, chosen by Linus Torvalds, is the little penguin shown in Figure . The Linux web site is www.linux.org and includes information on: 
  • Applications - Programs written to run on Linux 
  • Documentation - Linux documentation project and HOW-TOs 
  • Distributions - Organizations providing Linux packages 
  • Hardware - Compatible systems and components 
  • Courses - Tutorial for new users - Getting started with Linux 
  • Projects - General, hardware, software and scientific 
  • News - Linux news and articles

Linux was originally developed to run on the Intel x86 microprocessor (starting with the 30386) as a workstation or server. The Linux kernel has since been modified to run on several different CPUs in addition to the Intel x86. These CPUs include Intel IA-64, DEC Alpha, SUN SPARC/UltraSPARC, Motorola 68000, MIPS, PowerPC, and even the IBM mainframe S/390. In fact, Linux now runs on CPUs from a wider variety of manufacturers than any other OS.

GNU/Linux 

Many other components of the OS have been added through the efforts of independent developers and the Free Software Foundation's GNU (GNU's not UNIX) project (www.gnu.org). The GNU operating system uses the Linux kernel. The kernel is the heart of the OS that controls interaction between the hardware and applications. The GNU project refers to Linux as GNU/Linux, since many components of the OS are GNU applications. A good source of information and resources is the Linux documentation web site: www.linuxdoc.org

Open Source Software 

Linux is available at no expense under the GNU General Public License (GPL), as are other versions of UNIX such as FreeBSD and NetBSD. Linux is open source software, which means that the source code is publicly available and can be modified to suit specific needs. It can also be distributed freely among users. This concept is the opposite of commercial software, where the source code is not publicly available and each user must pay a license fee. Commercial software is based on copyright laws, which seek to limit what the user can do with respect to source code and distribution. Linux can be downloaded at no cost from various web sites.

Linux Distributions 

A number of for-profit companies and non-profit organizations make Linux available along with various combinations of applications, utilities and other software. These combinations of the OS and software are called distributions. As an example, Red Hat, Inc. bundles the Linux CDs, source code, and manuals along with a collection of applications and other products for a modest fee. These additional products include an office-suite, a choice of graphical desktops, Web server software, and so on. A level of customer support is also provided. Red Hat includes the Sun StarOffice suite of productivity software.

The primary component of any distribution is the Linux kernel itself. In addition to the kernel and applications, other components in a distribution include installation tools, the boot loader, and utility programs. Some distributions are more graphical and oriented toward the new user. Others are more basic and focus on developers and people who are already familiar with UNIX. Figure is an alphabetical list of some of the more common Linux distributions and their web sites:

Caldera OpenLinux        http://www.caldera.com 

Corel Linux                   http://linux.corel.com 

Debian GNU/Linux        http://www.debian.org 

Linux Mandrake            http://linux-mandrake.com/en 

Red Hat Linux               http://www.redhat.com 

Slackware Linux            http://www.slackware.com 

SuSE Linux                   http://www.suse.com 

Turbo Linux                   http://www.turbolinux.com

 

1.3 Overview of the UNIX Operating System
1.3.4 Benefits of UNIX and Linux
UNIX is a standards-based operating system and, although it varies somewhat from one version to another, the basis of the system is still UNIX. Nearly all-major computer manufacturers support some form of UNIX, which is a tribute to its importance as an operating system. It is one of the most powerful, flexible, and scalable OSs in the world. Most versions of UNIX in use today are commercial versions such as IBM AIX or Sun Solaris. The source code is not modifiable by the end user and there is a license fee for the OS. This is one of the reasons for the increasing popularity of Linux, which is open source and is relatively low cost to deploy. Nearly every computer manufacturer, in addition to having their own commercial version of UNIX, now offers and supports the Linux OS. These include Sun, HP, IBM, and others.

In general, UNIX in its various forms, continues to advance its position as the reliable, secure OS of choice for mission-critical applications that are crucial to the operation of a business or other organization. UNIX is also tightly integrated with the Transmission Control Protocol/Internet Protocol (TCP/IP). TCP/IP basically grew out of UNIX because of the need for LAN and WAN communications. TCP/IP is the acknowledged standard protocol of the Internet and many private networks. All workstations and servers running the TCP/IP protocols are referred to as "hosts" and are given an IP address and a host name. The IP address is what allows the host to be uniquely identified on the Internet. If a local translation file or a name server is available, the computer can be referred to by its name, which then is translated to its IP address. TCP/IP, IP addresses, and name servers will be covered more in Chapter 16, "Networking Concepts". 

Sun Solaris Benefits 

The Sun Microsystems Solaris Operating Environment and its core OS, SunOS, is a high-performance, versatile, 64-bit implementation of UNIX. Solaris runs on a wide variety of computers, from Intel-based personal computers to powerful mainframes and supercomputers. Solaris is currently the most widely used version of UNIX in the world for large networks and Internet Web sites. Sun is also the developer of the "Write Once, Run Anywhere" Java technology. The benefits of UNIX and Solaris are summarized in the Figure.

Linux Benefits 

In general, Linux includes the same benefits as UNIX. It is most often used for workstations and for small to medium servers. It is not currently widely implemented on high-end servers, but this is changing. In addition to those listed, Linux has the added benefit of being open source software and is available at very low cost. There is also a huge Internet user community that supports and promotes Linux.

 

1.4 The UNIX Operating Environment
1.4.1 Overview
UNIX is a collection of components that together make up an operating environment. Each version of UNIX varies somewhat from the others but all share the same basic characteristics.

Solaris

The OS environment on Sun systems is called the Solaris Operating Environment. The Solaris environment consists of the SunOS 5.x operating system, the Open Network Computing (ONC) protocols, and a graphical user interface (GUI). SunOS 5.x is a multiuser, multitasking network operating system that is based on the standard SVR4 UNIX operating system. ONC is a family of published networking protocols and distributed services that enable remote resource sharing, among other things. The Solaris environment supports four graphical interfaces: Common Desktop Environment (CDE) and Sun's Open Windows (bundled with the Solaris Operating Environment), GNU Network Object Model Environment (GNOME), and the K Desktop Environment (KDE). This course introduces CDE, GNOME, and KDE.

Linux

The Linux operating environment is similar to that of Solaris but the components can vary depending on the distribution. All distributions include, at a minimum, the Linux kernel, standard TCP/IP networking protocols, an installation package, the GNOME or KDE graphical desktop, and various configuration and management utilities.

 

1.4 The UNIX Operating Environment
1.4.2 The OS and the kernel
The OS is a set of programs that manages all computer operations. It also provides a link between the user and system resources, converting requests that come from the mouse or the keyboard into computer operations. Most operating systems, including UNIX, have four main components: 
  • The kernel manages the operation of the computer. 
  • The shell provides for interaction between the user and the computer. 
  • The file system provides a way to organize and manage the information on the computer's hard disk(s). 
  • The commands, or utilities, are used to instruct the computer to perform tasks. 

These main components are summarized in Figure . Much of the following information applies to all varieties of UNIX, although some of the information is Solaris or Linux specific.

UNIX Kernel Overview 

The kernel is the core OS with the necessary basic capabilities to run the computer. The kernel is the closest to the CPU and hardware. It is an executable file that gets loaded when the computer boots and is conventionally named "unix" in System V-based systems or "vmunix" in BSD-based systems. Solaris contains two kernel files: a platform-independent generic kernel file that is combined with a platform-specific kernel file for a specific Sun system. These two combined files create the static core kernel that initializes and controls the system.

The Linux Kernel 

The development process for the Linux kernel is interesting and somewhat unique. Linus Torvalds maintains control of how the Linux kernel evolves, with input from people all over the Internet. Periodically, a group of developers review and test the latest contributions and release a stable version of the OS kernel. The most current version of the kernel is 2.4.7. In this numbering sequence, the numeral 2 represents the major version number and the numeral 4 represents the minor version number. The numeral 7 in the kernel number is a release or patch number. If the minor version is even, then this indicates a stable version of the OS that can be distributed to the Linux community. If the minor version is odd, then this is a development version.

Kernel Functions 

After the kernel loads, it performs the following functions (see Figure ): 

  • Manages devices, memory, and processes 
  • Controls the functions, or transmission of information, between the system programs and the system hardware 
  • Manages functions such as swap space, daemons, and file systems 
    • Swap space is a reserved part of the hard disk that the kernel uses during processing. Portions of running programs can be "swapped out" of RAM into the hard disk, and then brought back into RAM if necessary. This swap space is actually on the hard disk, but it looks like additional memory to a running program. Swap space is a raw slice, or disk file, that is set-aside during system installation. As previously mentioned, RAM is physical memory. The swap space on the hard disk represents "virtual memory" and is used to increase the size and number of programs that can be run. Most UNIX systems set up a swap space of twice the amount of RAM, or a minimum of 32 MB. Swap space is not RAM, but the operating system treats it like RAM to provide extra memory to the programs that are running. In Figure , the kernel is swapping programs in and out of the swap space on the hard disk. 
    • Daemons are programs that perform a particular task, or monitor disks and program execution. Daemons are special processes that begin after the OS loads. Daemons then wait for something to do in support of the OS. They can be started or stopped as necessary. An example is the printer daemon, line printer scheduler (lpsched). It starts when the system starts up and then waits in the background until someone needs to print something. Daemons in the UNIX world are similar to Services with Windows NT/2000 or Netware Loadable Modules (NLMs) with Novell NetWare. 
    • File systems are a hierarchy of directories, subdirectories, and files that organize and manage the information on hard disks. File systems can be either local or remote. Local file systems are located on the hard disk of a workstation. Remote file systems are located on another computer, which is usually a server.

 

 

1.4 The UNIX Operating Environment
1.4.3 The OS shell
A shell is an interface between the user and the kernel. It acts as an interpreter or translator. In other words, the shell accepts commands issued by the user, interprets these commands, and executes the appropriate programs. Shells can be command-line driven or graphical. Three command-line shells are available in the Solaris UNIX environment. It is possible to initiate or switch between these shells when working on the computer. The process status (ps) or echo $SHELL commands are used to determine which shell is in use. The Solaris Operating Environment has six available shells that come with Solaris 8. The three primary command-line shells that are available in all UNIX versions are the Bourne shell, the Korn shell, and the C shell. These are common to most commercial versions of UNIX. The other three shells, BASH, Z shell, and TC shell, have been gaining in popularity among UNIX users. The BASH shell is the default for most Linux distributions, though others are also supported. CDE, GNOME, and KDE are sometimes considered to be graphical shells.

The following list explains the different shells available within a UNIX environment: 

  • The Bourne shell (/bin/sh) was the original shell program for UNIX. It is the default shell for the Solaris computing environment. Stephen Bourne developed the Bourne shell for the AT&T System V.2 UNIX environment. This shell does not have aliasing or history capabilities (see Chapter 14 - "Shell Features and Environment Customization"). System administrators mostly use it. The Bourne shell prompt is a dollar sign ($) which is similar to a DOS C:\> prompt. 
  • The Korn shell (/bin/ksh) is a superset of the Bourne shell and was developed by David Korn at Bell Labs. It has many of the Bourne shell features, plus added features such as aliasing and history. This is the most widely used shell and is the industry standard for system users. The Korn shell prompt is also a dollar sign ($).
  • The C shell (/bin/csh) is based on the C programming language. Similar to the Korn shell, it has additional features such as aliasing and history. The C shell was developed by Sun's Bill Joy and is still widely used today. The C shell prompt is a percent sign (%). 
  • The Bourne-Again Shell (bash) has the feel of the Bourne and Korn shells and incorporates features from the C and Korn shells. Bash is the most popular shell with Linux and is the default for most distributions. Bash can be downloaded from GNU (www.gnu.org). 
  • The TC shell (tcsh) is a popular variant of the C shell that supports command-line editing and command-line completion. 
  • The Z shell closely resembles the Korn shell, but it has many other enhancements.

Note: Examples given in this curriculum are based primarily on the Korn and Bash shells.

Lab Activity
  UNIX Computing Environment

This lab exercise will review UNIX computing environments terminology and help to reinforce concepts introduced in Chapter 1. The student will also investigate the use of UNIX at their institution or another organization and research web sites to see what organizations are using Solaris UNIX.

 

1.4 The UNIX Operating Environment
1.4.4 The file system
The file system provides a way to separate and keep track of the information on a hard disk. The file system determines the type, characteristics, and arrangement of files that can be stored on disk. A file system is created on a disk partition using the formatting process. A partition can occupy the entire hard disk or can be a subdivided segment of the disk. Partitions will be discussed further in chapter 8, "File System Systems and File Utilities". 

Formatting is similar to putting up street signs in a new residential area. No one lives there yet, but the home locations are identified.

There are many different types of file systems supported by various operating systems. Those file systems common in the Windows environment include the File Allocation Table 32-bit (FAT32) and New Technology File System (NTFS). Sun Solaris uses the UNIX File System (UFS). Linux uses primarily the Second Extended File System (ext2) or Third Extended File System (ext3). A hard disk may have one or more partitions or file systems defined on it.

The file system provides for the definition of a file structure. The file structure is a hierarchy of directories, subdirectories, and files that are grouped together for a specific purpose. File system support is integrated with the kernel to provide an organizational structure for software and data (see Figure ). The file structure organizes the information on hard disks to make them more manageable, and it enables users to locate files. Hard disks can be divided into partitions with file systems, directories, subdirectories, and files. The file system organizes data similar to the way a file cabinet stores information. The file system is like the file cabinet, directories are like drawers, subdirectories are like folders, and files are like the pages in a folder.

A directory hierarchy looks like an inverted tree, with the root at the top (see Figure ). The following is the hierarchy of the UNIX file system: 

  • The file system is a formatted structure set up on one or more partitions to store files and directories. Partitions and the associated file systems are similar to the drive C: or D:, in the Windows/DOS world or like volumes with Novell NetWare. File systems can be either local, meaning on the user's computer or remote, meaning on another computer but accessed as if it were local. 
  • The directory is a location for files and other subdirectories. The Solaris file system, or directory structure, enables the user to create files and directories accessed through a hierarchy of directories. A directory is like a file drawer in a file cabinet. The highest directory in the directory structure of a file system is the root directory, which is designated as a single forward slash (/). 
  • The subdirectory is any directory below another directory. For example, some of the subdirectories under the root (/) directory are /usr, /etc, and /home. 
  • The files are contained in directories and subdirectories. They are the lowest level of the file system. There are usually thousands of files on a hard disk and there are several different types: 
    • Directories are considered a type of file under the UNIX file system. 
    • Plain ASCII (American Standard Code for Information Interchange) files are pure text files, with no special formatting characters in them. 
    • Application files are created by an application such as a word processor, spreadsheet, or database program. 
    • Executable programs are UNIX utility commands and application programs.

Common UNIX Directories 

The topmost directory in a file system is called the root directory. It is the starting point of the file-system hierarchy. The root directory (/) is required for the operating system to function, and it contains critical system files such as the kernel. The following list contains some of the more important directories and their purposes. The slash in front of these directories indicates that they are actually subdirectories of the root directory. See Figure . UNIX directory structures such as directory names, locations, and contents can vary from one version to another. Linux directory structures are relatively consistent with most distributions adhering to the Linux File System Standard (FSSTND) or the Filesystem Hierarchy Standard (FHS). 

The following list of directories is not intended to be all-inclusive, but does include those most commonly found on UNIX systems:

Note: The directories followed by a * (single asterisk) are specific to Solaris. Those followed by a ** (double asterisk) are specific to Linux. All others are common to both.

  • The /bin (binary) directory contains many of the UNIX commands. 
  • The /boot directory** contains most of the files necessary to boot a Linux system. 
  • The /dev (devices) directory contains files that are pointers to device file names. All devices in UNIX have standard filenames. 
  • The /etc (etcetera) directory contains system administration files, such as the password file. This directory is commonly referred to as et-cee. 
  • The /export/home directory* contains the user home directories. Depending on how the system has been set up by the administrator, the home directories could be found in /home. 
  • The /home directory contains the user home directories. 
  • The /kernel directory* contains the basic operating system files, such as the main UNIX kernel genunix. 
  • The /lib (library) directory contains common library files used by programs in the /bin and /sbin directories. 
  • The /mnt (mount) directory** is the standard mount point for files systems such as the floppy disk and CD-ROM. 
  • The /opt (optional) directory contains Sun's unbundled software applications and third-party applications. This directory is not always used with Linux. 
  • The /proc (process) directory** contains files relating system information used by the kernel. 
  • The /root directory** is the super users home directory. 
  • The /sbin (single user binaries) directory contains essential executables used in the booting process and in system failure recovery. This directory also includes some system-administration utilities. 
  • The /tmp (temp) directory contains temporary files placed by users. Occasionally, files in /tmp get deleted by an administrator or automatically are deleted as part of system startup. 
  • The/usr directory contains files and programs used by all users. 
  • The /usr/bin (user) directory contains executable commands, system administration utilities, and library routines. 
  • The /usr/src directory** contains the Linux source code. 
  • The /usr/ucb directory contains commands originally developed under BSD UNIX. They exist because some users prefer the BSD version of a command to the System V version. 
  • The /var (variable) directory contains dynamic and variable data such as print spooling and mail system error messages.

UNIX Commands 

Unix commands are key to maintaining the file system. The UNIX operating system comes with more than 350 commands and utility programs. These UNIX commands and utility programs are used to perform the following functions: 

  • File maintenance such as creating, editing, copying, deleting, and so on 
  • Administration such as adding new users, printers, disks, and so on 
  • Printing 
  • Networking and communication 
  • Programming 
  • Obtaining help 

Commands tell the shell what to do, such as list the contents of a directory or copy a file. Some commands are built into the shell program, such as change directory (cd) and exit. Most commands reside on the hard drive in a directory named bin, which is short for binary code.

 

1.4 The UNIX Operating Environment
1.4.5 Graphical user interface (GUI) options
All modern operating systems include a graphical user interface (GUI). A number of popular ones, including Microsoft Windows, UNIX CDE, and several others, will be covered. 

Common Desktop Environment (CDE) 

Sun Microsystems was the first company to use a windowing environment in conjunction with the UNIX OS. In 1993, a consortium of UNIX platform vendors was formed to develop an integrated, standard, and consistent GUI desktop environment. The contributors included Hewlett-Packard, IBM, Novell, and Sun Microsystems. Many other companies and members of the Open Software Foundation (OSF), X/Open, and the X Consortium also contributed. CDE is Motif-based and users of other UNIX and personal computer (PC) desktops should be comfortable using CDE. Many of the features of CDE are common to other desktop environments. 

The Common Desktop Environment (CDE) offers the following for users: 

  • Provides a GUI between the user and the OS 
  • Includes built-in menus for users to select and run utilities and programs without using Solaris Environment commands 
  • Provides more than 300 utility programs and tools 
  • Enables users to control multiple documents or applications on the screen at the same time 
  • Controls activities in windows using both the mouse and the keyboard 

Figure represents some of the major programs and tools available with CDE, including Calendar, file management, e-mail, printer management, and notes. Figure shows a typical CDE screen. CDE is discussed in greater detail in subsequent chapters.

Open Windows 

Open Windows is Sun's original GUI developed for the Solaris environment (see Figure ). It is similar to CDE, but it is proprietary and not well supported. The user has a choice when logging into a Solaris workstation to select either CDE or Open Windows.

GNU Network Object Model Environment (GNOME) 

The latest windowing system to emerge in the UNIX world is GNOME. GNOME is part of the GNU open source software project. GNOME has an easy-to-use desktop environment for the user, a powerful application framework for the software developer, and it is free of cost. GNOME (http://gnome.org) is included in most BSD versions of UNIX and with GNU/Linux distributions. GNOME also works with many other UNIX systems, including Solaris (www.sun.com/gnome). 

GNOME combines advanced desktop organization and navigational features that enable easy access to information. See Figure . It provides usability, appearance, and personalization to match a user's unique working style. 

The GNOME Desktop key features include the following: 

  • Attractive, intuitive user interface 
  • Personalization capabilities 
  • Convenient front panel for rapid access to favorite programs 
  • Full suite of powerful applications 
  • Capability to run existing CDE and Java-based applications

K Desktop Environment (KDE) 

KDE is a mature, full-featured desktop environment that is used primarily with Linux. As with GNOME, KDE is also open source software and is freely available. KDE can run with several varieties of UNIX. Most distributions of Linux come with KDE as well as GNOME. The K does not stand for anything in particular. It is just the first letter in the alphabet before L, which represents Linux. Solaris also supports KDE and is available on the Solaris Software Companion CD co-packaged with Solaris or downloaded from http://wwws.sun.com/software/solaris/freeware/.

 

  Summary
The main components of a computer are RAM, CPU, I/O, and disk. They are controlled by the operating system. 

Most desktop operating systems are intended for use by a single user. Network operating systems such as UNIX are usually installed in servers that can support many users and large networks. 

UNIX originally was developed at Bell Labs, and significant improvements were made at UC Berkeley, including the addition of networking capabilities. The industry standard SVR4, lead to the development of several current varieties of UNIX including Sun Microsystems Solaris. 

The key pieces of the Solaris Operating Environment are the SunOS, the Open Network Computing (ONC) protocols, and the Common Desktop Environment (CDE) GUI. 

The main components of the SunOS are the kernel, the shell, the file system, and commands. The kernel manages hardware, daemons, swap space, and the file system. The shell is an interpreter that provides an interface between the kernel and the user. The file system manages and organizes information on the hard disk. Commands dictate what action the shell is to take. 

Several graphical desktop shells are available for UNIX. CDE is used primarily in the commercial environment. GNOME and KDE are open source desktops used primarily with Linux.

 

  Overview
In this chapter the student will learn the requirements for user accounts and passwords. Also covered in this chapter is the procedure for logging in and out of the system using both the command line and graphical login manager. Students will become familiar with the UNIX Common Desktop Environment (CDE), basic features and functions of CDE, and how to use the Style Manager to customize the CDE workspace. GNU Network Object Model Environment (GNOME) and K Desktop Environment (KDE) graphical desktop managers will be introduced as well as working with GNOME panels and menus.

 

2.1 User Accounts
2.1.1 Account types
Users must have an account to access resources on a UNIX system. User accounts identify a user to the system. Accounts also determine what activities a user can perform and what files a user can access. Two types of accounts exist on a UNIX computer. They are the root or superuser account and user accounts.

The Root Account

The root account is the system administration account and is created automatically during the operating system installation process. The root account is the only account on the system when it is first installed. The root login account owns all system files and has access to all files. It is similar to the Administrator account with Windows NT/2000 and the Admin account with Novell NetWare.

The root account creates new users, manages file systems, installs software, and performs other high-level system administration tasks. The root account can access and modify any file or directory on the system. Because it is "all powerful," the root account should be used sparingly. Most UNIX administrators have a user account with special administrative privileges that they use on a daily basis and log in as root only when necessary. This minimizes the risk of leaving the root account exposed by accidentally walking away from the system while logged in as root and potentially having the system compromised.

User Accounts

User accounts are created and maintained by the system administrator when logged on as root. Every user who needs access to the system must have a user account to log in and use the computer. Regular users can run applications and customize their working environment. They also can create and modify files in their home directory and subdirectories below it (See figure).

2.1 User Accounts
2.1.2 Login ID and password requirements
Login ID

For users to log in, they must have a user account that includes a login identification (ID) and password. The login ID is the user's public name and is commonly referred to as the user name. Depending on the system administrator, login IDs are usually some combination of a user's first and last names. For example, user Bob Wood's login ID might be bobw, bwood, woodb, or bw2. The login ID must be unique on the system and there are usually some limitations on the type and number of characters that can be used. Login IDs on Solaris systems are limited to eight alphanumeric characters. Solaris system login IDs can be any combination of upper or lowercase letters, numbers, and special characters such as: !, $, -, _, and so on. See Figure . Most versions of Linux limit the login ID to 32 alphanumeric characters or less. It is best to keep login IDs to eight or less alphanumeric characters and use special characters sparingly. Dashes and underscores are recommended. When creating the user, the administrator can also include the user's full name. The login ID, user's full name, and other account information are stored in the password (/etc/passwd) file, which can be viewed by all users. User passwords, in encrypted form, are stored in the /etc/shadow file.

Passwords

The user's password protects the account from unauthorized access. In both Solaris and Linux there are specific rules for creating passwords to help ensure system security.

Solaris and Linux passwords must be at least six characters in length and different from the login ID. The first six characters of the Solaris password must contain at least two alphabetic characters and at least one numeric or special character. Linux passwords can be any combination of alphanumeric or special characters and there is no requirement for what the first six must contain.

Passwords are case sensitive. This means that they can be created with uppercase or lowercase letters and must be entered exactly the same way when logging in. For example, the password ABc123 is different from the password ABC123. When changing Solaris passwords, the new password must differ from the previous password by at least three characters. When changing Linux passwords, the new password must contain no more than two successive characters from the previous one and cannot contain dictionary words. Passwords may contain spaces and special characters. As an example, the password a9$B7 c5 is perfectly valid. The length is six or more characters, it also has upper and lowercase letters, numbers, a special character, and a space. See Figure for a list of Solaris password requirements that apply to user accounts.

Note: The password requirements above do not apply to the Solaris root account password or to any user password assigned by the root user. These rules apply when a Solaris user changes their password. The Linux root user password follows the same rules as a regular user account.

 

2.1 User Accounts
2.1.3 Local and remote access
Local Access

Most UNIX systems provide two ways to directly access a system. The user can login using either a graphical interface such as CDE, or the standard character based login.

Remote Access

A user can also access a UNIX system from another computer such as a Windows PC, Apple Macintosh, or even another UNIX system. To login to a remote UNIX workstation or server the character based Telnet program or a graphical terminal emulator is used. The UNIX command rlogin, for "remote login", can also be used to log into another Solaris host on an accessible network.

CDE provides a graphical user interface for local access to a UNIX system. However, the login can be performed using any UNIX GUI or any graphical programs remotely from a Windows PC using an X-Windows terminal emulator program. X-Windows is the standard graphical support system for UNIX. Emulators are available from such companies as StarNet (www.starnet.com), Hummingbird (www.hummingbird.com), or Tarantella (www.tarantella.com). When finished working with UNIX exit the emulator program and return to Windows. It is also possible to cut, copy, and paste between the two environments.

CDE Login Manager

Most Solaris workstations have the graphical Common Desktop Environment (CDE) installed and will boot automatically to a graphical environment. Before logging into the account, CDE displays the graphical Login Manager screen shown in Figure .

Four buttons are located at the bottom of the Login Manager screen:

  • OK, accepts the username and password as entered
  • Start Over, clears the username and password fields
  • Options, provides several choices for logging in
  • Help, provides assistance for using Login Manager

Logging in identifies the user to the system. To log in, use the login screen shown or log in at the command line. When the CDE Login Manager screen is used, the user enters the CDE graphical user interface (GUI) environment.

Options Button

The CDE Login Manager Options drop down menu provides a set of choices for logging in. Five choices are available with the Options menu as summarized in Figure :

  • The Language option typically is set at installation and is not used often.
  • The Session option offers a choice of GUI desktop environments (CDE or Open Windows) and provides a Failsafe login option, which can be used for troubleshooting.
  • Remote Login allows the user to log into another Solaris machine, such as a server or another workstation on the network.
  • The Command Line Login option bypasses the GUI environment and goes directly to a console prompt. It stays at the command line.
  • The Reset Login Screen option restores all settings to their defaults.

 

2.1 User Accounts
2.1.4 Logging in and out using the CDE login screen
Logging In with CDE 

The CDE login screen replaces the usual login prompt common in UNIX systems. The Login screen is the entry point into the system. If a login ID, or user name, and password have not been assigned, the system cannot be accessed. The username for the interactive media activities will be user2. 

Enter the login name in the appropriate boxed area and then press the Return key or left click the OK button. If the login name or password are typed incorrectly, the process must be repeated using the correct information. 

The Start Over button completely refreshes the screen and removes any typed entries. Once logged into the CDE graphical desktop, a front panel is presented, which is the primary desktop management tool.

Tip: If a mistake is made when entering either the login name or password, reenter both pieces of information. Press Ctrl+u, Ctrl key and a lowercase letter u, to 'undo'. This will clear the screen. The user can also left click the Start Over button to return to the login display. 

Exiting from CDE 

Logging out prevents unauthorized users from gaining access to personal files. Logging out should occur whenever the user is going to be away from the system for an extended period of time. To leave the CDE session and log out of the UNIX system, click the Exit button on the front panel. It is not necessary to shut down the typical UNIX computer because these computers are designed to be left running. However, if the system must be shut down, always be sure to exit (log out) first. By default, the user will be asked to confirm that log out is desired. Confirmation is done by clicking the OK button or by pressing Return when the OK button is highlighted, as shown in Figure

The current CDE session is saved automatically so that the user can return to the same workspace windows at the next CDE session. However, any data contained in the current set of open windows will be lost. Therefore, save all data before exiting from the CDE session. It is possible to change the default activities of the Exit button so that confirmation is not required. This is discussed later, in the section "Customizing the Workspace with Style Manager". Upon exiting the system, return to the CDE Login Manager screen. Use the interactive media activity to practice logging in using the CDE login screen.

Interactive Media Activity (Flash, 103 kB)  
  Using the CDE Login Screen

Work through the interactive media activity to practice logging in and out of a UNIX system using the Login Manager screen.

 

2.1 User Accounts
2.1.5 Logging in and out using the command line and telnet
Command Line Login 

An alternative to logging in with the CDE login screen is to bypass the CDE graphical desktop and go directly to the command line. To log in from the command line, display the Options drop down menu and select Command Line Login. Press Return quickly, or the Login Manager will restart. 

Enter the username at the console login and then the password at the password prompt. 

Command line login is quick because the CDE graphical desktop is not loaded. Use this option to do file management or troubleshooting from a shell prompt.

Note: The password does not appear as typed. By default, if the user does not have a password, an automatic prompt will ask that one be created during the initial login.

Exiting from the Command Line

To log out while at the command prompt, simply type exit and press Enter. This exits the user from the system and redisplays the console login prompt. If the user does not log back in within 30 seconds, the CDE Login Manager screen is displayed again. Use the accompanying media activity to practice logging in and out as user2, using the command line.

Remote Access Using Telnet 

Another way to access the command line of a remote UNIX system is to use the Telnet program. The procedure for accessing a remote UNIX system depends on what Telnet program is in use. Telnet programs include UNIX telnet command, Windows Telnet, NCSA Telnet for Macintosh users, or a shareware Telnet program. To Telnet to another system, the IP address or host name of the remote UNIX workstation or server must be specified. When a connection is established with the remote host, the user will be asked to enter a valid username and password. IP addresses and the UNIX Telnet program are covered in Chapter 16, "Network Concepts". Figure shows the connection screen when using the Windows Telnet program. After connection is established, another screen appears requesting a valid username and password.

Tip: Sometimes the Backspace and Delete keys will not work after attempting to use Telnet to access a remote UNIX system. Some Telnet programs provide an option that allows the user to define these keys. If the Telnet program does not allow these keys to be defined, type stty erase at the shell prompt after log in. Next, press the Backspace key, this will enter a ^H, followed by Enter. This allows the Backspace key to work properly.

Tip: On most systems, the Ctrl and d keys (Ctrl+d) can be used to log out or exit a Terminal window. C shell users also can choose to use the logout command. Any other commands, such as 'bye', might be an alias set up by the administrator that runs the exit command and might not work on another UNIX system.

Interactive Media Activity (Flash, 127 kB)
  Using Command Line Login

Work through the interactive media activity to practice logging in and out from a UNIX system command-line environment.

 
2.1 User Accounts
2.1.6 The login process and the /etc/passwd file
During the login process, the system refers to two special files to determine if a valid user is attempting to access the system. Those two files are the /etc/passwd and the /etc/shadow files. Figure shows the UNIX login process and the interaction with these files.

The /etc/passwd File 

The /etc/passwd file contains the master list of user information. It is consulted each time someone attempts to access the system. Each line in the passwd file represents a single user's account information and contains seven fields separated by a colon. Each entry has the form shown in Figure . Entries are spread out for readability.

Here is an example: mmouse:x:1100:10:Micky Mouse in sales:/home/mmouse:/bin/ksh 

Each of the seven fields has a unique meaning:

  • The name field contains the username assigned to the user by the administrator. Usernames are typically some combination of a user's first and last name. If the username entered on the login screen does not match any username listed in the /etc/passwd file, that user will not have access to the system. 
  • The password placeholder field contains an 'x' or an exclamation mark (!) in some versions of UNIX. These symbols tell the system to look for the encrypted password in the shadow password file /etc/shadow. The shadow file is protected from all users except the root user, to prevent hackers from trying to crack user passwords. 
  • The user identification (UID) number is assigned by the system administrator. The UID identifies the user to the system. This number relates to the username and is used to determine ownership of files that the user creates, as well as access to files and directories. The system administrator can assign the user ID, or the system will generate one automatically when a new user is created. The UID of the root user account is 0. 
  • The user's primary group membership number (GID) relates to a group or set of users working on the same project. The GID is the name that is used to determine group ownership of files that the user creates, as well as access to files and directories. The system administrator assigns the group ID. For example, one group may be Finance for the accountants that access the system. 
  • The User information field typically contains the user's full name. This allows anybody viewing the /etc/passwd file to determine who is associated with a potentially cryptic username. It may also contain a department name or other information. This information is also used by mail systems and commands. 
  • The user's home directory field contains the absolute path name of the user home directory. When users log in, the system automatically places the users in their home directory, where their personal files are located. 
  • The shell program field contains the path name. This path name leads to the program that UNIX uses as the command interpreter for the user. The path name functions when the user first logs in and when a Terminal window is opened.

Tip: The user can find out the UID number, username, GID number, and group name for an account by typing the id command at the command prompt.

 

2.1 User Accounts
2.1.7 Proper UNIX system shutdown
UNIX systems are designed to be left running continuously and are normally shut down by an administrator (the root account password is required) to install a new release of the operating system, add hardware, or perform routine system maintenance.

If the user must power off a UNIX system, it is important to shut down correctly. This is the case with most operating systems. It allows all system changes recorded in RAM to be written to disk and facilitates an orderly shutdown of processes and file systems. It is similar to clicking Start/Shutdown with Windows 9x or NT/2000/XP. Failure to do so can result in file corruption.

Using the system initialization state (init) and shutdown commands are the primary ways to shut down a UNIX system. The figure shows the use of the init command to begin the shutdown process. Most GUI desktops provide the ability to logout or exit from the current login session in order to login as another user. The user must be logged in as the root user to shutdown most UNIX systems. GNOME also provides the option to shutdown or reboot the system from within the GUI.

Step 1. Either login as root or switch to the root account using the su command, which is covered in Chapter 8.

Step 2. Shut down the system by using either the init 0 or the shutdown commands. The system initialization state of 0 is off.

Step 3. Power off at the type any key to continue prompt on an Intel PC or the OK prompt on a Sun workstation. The system may power off automatically with some versions of UNIX.

 

2.1 User Accounts
2.1.8 Changing a password
Changing the user password frequently helps prevent unauthorized access to the system. The actual process of changing the password is the same whether the user is logged in through CDE or the command line. In either case, the password is changed at the command line.

Opening a Terminal Window 

If logged into a CDE session, right click the background to bring up the Workspace menu, click Tools, and open a Terminal window, as shown in Figure . To open a terminal window with GNOME, click the Terminal Emulation Program icon on the panel at the bottom of the screen, as shown in Figure .

The Terminal window gives the user access to a command line $ prompt. The dollar sign ($) represents a Korn, Bourne, or Bash shell. The percent sign (%) for the C Shell or a number or pound sign (#), also may indicate that the user is logged in as root. After the Terminal window opens, type the passwd command after the system prompt and press Return. When prompted to enter the login password, type the current password and press Return. When prompted for a new password, type the new password following the rules discussed previously and press Return. The user then is prompted to retype the new password to confirm it. This is required for verification of the new password by the system. Use the accompanying media activity to practice changing the password for user2 using the command line in a Terminal window. Follow the rules for valid passwords which were previously covered. Remember that passwords are case sensitive and can contain spaces and special characters.

Note: On some CDE systems, the Terminal window program can be found under the Windows Workspace menu option or on the Applications submenu. 

Prompts to Change a Password 

Figure shows the series of prompts that results from the passwd command on a Solaris system. The prompts are similar on a Linux system. 

Note: The password will not appear on the screen as it is typed.

Tip: If there are problems accessing the account, contact the system administrator.

Password Aging 

Password aging is a security feature that might or might not be implemented by the system administrator. Password aging options can include requiring a user to change the password after a certain number of days, setting an absolute expiration date when the account can no longer be accessed, and even locking the account after a certain number of days of inactivity.

Forgot the Password? 

If the password is forgotten, the only option is to contact the system administrator. The administrator will not be able to tell the user what their password is, but they will be able to assign a new, temporary one. When the new password is given, immediately use the passwd command to change the password to one that can be remembered.

Interactive Media Activity (Flash, 85 kB)
  Changing a password

Work through the interactive media activity to enter the commands to change the user login password.

Note: The system administrator, logged in as root, can change the password for any account by entering the passwd command followed by a user name. For example, if the administrator wanted to change the password for user jsmith, the proper command would be $ passwd jsmith. The administrator will then be prompted for the new password directly.

Lab Activity
  Accessing the system

In this lab, the student will review the requirements for UNIX login IDs and passwords. The student will practice logging in to a UNIX system using the CDE login screen. The student will then change their password, exit or log out, and return to the CDE login screen.

 

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.1 Front panel layout
This section discusses ways in which the student can familiarize themselves with the CDE.

Workspace Buttons 

When the student logs into a CDE session, four workspaces are available to them by default. See Figure . Each workspace is equivalent to a complete desktop environment. The following buttons surround the workspace: 

  • The workstation lock icon
  • The "system busy" globe icon 
  • The EXIT icon 

The user can independently set the characteristics of each workspace as well as add more workspaces and desktops, if needed. The user can alternate among the workspaces by left clicking the appropriate workspace button. On the Sun workstation use the keyboard metakey (diamond) combined with the left or right arrow keys. 

Multiple workspaces or virtual desktops can be useful. The user could have one desktop arrangement for administrative tasks, one for applications and regular user tasks, one for special projects, and another for application development.

The Front Panel Arrangement 

The front panel allows the user to manage applications, files, and network services easily. The front panel has been organized to include icons for a Web browser, text notes, and a performance meter. See Figure . The subpanels contain cascading submenus for ease of navigation. Click an up arrow button to open a subpanel, then click an item in a subpanel to run it. The spinning globe above the Exit button indicates that the system is busy. When the spinning globe is clicked, it becomes an "Action: Go" entry panel. It then prompts the user for a uniform resource locator (URL), path name, host, email address, and so on to open. See Figure .

Note: In some locations, the function of the metakey differs. It might be necessary to use the Alt key or the spacebar with the arrow keys to perform the function described here.

Front Panel Menu Button 

At the top left side of the front panel is the Front Panel window menu button. If this is selected, a menu of choices is displayed. See Figure . From this menu, it is possible to perform the following actions:

  • Minimize the front panel display.
  • Lower the front panel display behind overlapping windows. 
  • Refresh the entire workspace display. 
  • Log out from the CDE session.

Move the front panel to another location on the screen. Dragging the front panel to a new position by one of the move handles also can do this. 

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.2 Using the mouse and keyboard
The mouse and the keyboard are the primary input devices for most computers. The user may be working with a Sun Solaris workstation or an Intel based personal computer running either the Solaris or Linux operating system. It is helpful to understand the differences between the Sun workstation version and the typical PC version of these two input devices.

The Mouse 

A mouse is used with the CDE in a similar way as with other graphical user interfaces. The mouse settings can be modified to suit a user's preferences. When a setting has been modified, that setting can be stored into a user specific file. Any personalized settings will be the default whenever a CDE session is initiated. The mouse used with a Sun workstation has three buttons, a left, middle, and right button. See Figure . Most personal computers typically have two buttons, a left and a right button. The middle mouse button with the Sun workstation is used primarily as a paste button. We will focus on the function of just the left and right buttons.

The Left Mouse Button 

Most actions use the left mouse button, alternatively known as button 1 or the SELECT button. This button is used to make selections in any of the following ways: 

  • Make a window active Click the left mouse button while the mouse pointer is in that window area. 
  • Invoke a window menu Click the left mouse button while the mouse pointer is on the window's menu box area. 
  • Select an option from the front panel
  • Select a File or Folder icon The user can do this while working with the File Manager. 
  • Open an icon Double click the left mouse button while the pointer is over the icon. 
  • Highlight text to be selected Drag over the text area while the left mouse button is being pressed.

Note: For the purposes of this course, the student will be instructed to click, indicating a left click or right click, to perform a specific action. These instructions are based on standard right hand configuration of the buttons. These notes will also instruct the student when a double click is required.

The Right Mouse Button 

When the right mouse button, or the MENU button, is clicked or held down, a menu of choices appears. This is button 3 on a Sun workstation. The options available on the menu are determined by the position of the mouse pointer when the right button was pressed.

The Keyboard 

This section contrasts the Sun workstation and PC keyboards.

PC Keyboard 

It is useful to compare the two keyboards so that the student can work with either one. As with the mouse, the Sun workstation keyboard and the PC keyboards differ. See Figure

A typical PC has a keyboard with 104 keys and 4 major sections or areas on the keyboard: 

  • Typewriter keys for letters, special characters, Ctrl, Shift, Alt, and others. 
  • Function keys labeled as F1, F2, F3, and so on. 
  • Cursor management keys labeled as Insert, Home, End, arrow keys, and others. 
  • Numeric keypad

Sun Workstation Keyboard 

The Sun workstation keyboard is wider than the one for a typical PC. It has all the previously mentioned keys and a few more, for a total of 118. Most of the additional keys are in two additional sections of the keyboard. A section to the left of the keyboard provides 10 keys for window management and common functions such as cut, copy, and paste. A large Help key is in the top left corner of the keyboard. In the typewriter portion of the keyboard are two keys with a diamond shape outline on them, known as metakeys. These two keys perform various functions, such as alternating between workspaces. Another section exists at the top right, which controls sound volume.

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.3 Managing windows
Most PC users are accustomed to working in a graphical environment with windows. The UNIX Common Desktop Environment (CDE) is very similar in its operation. The following are common tasks that are normally performed in a windowed environment.

Tip: Use the Front key to bring a window currently behind another window to the front. Use the Open key to open a minimized program residing on the desktop as an icon or to reduce an open window to an icon. Use the Copy and Paste keys to paste long path names from one Terminal window to another.

Overlapping Windows 

When an icon is selected from the front panel, a window opens on the workspace screen. Windows on the workspace overlap each other, with the most recently opened window overlapping previously opened windows. See Figure

Lowering a Window 

To choose the window menu, position the mouse pointer on the window title area and press the right mouse button. One option in the resulting menu is to lower the window. This option forces the window to the back of the overlapping windows on the screen display. See Figure

The alternative keyboard action is to hold down the Alt key and press function key 3 (Alt+F3).

Note: There is no alternative to moving a window to the front of a set of overlapping windows. When selected, a window automatically comes to the front of any overlapping windows in a CDE display. On a Sun workstation keyboard, the Front key brings a window to the front of the display. See Figure

Moving a Window 

A window can be moved in two ways. One way is to choose the Move option from the window menu. The mouse pointer changes from an arrow pointer to a small cross pointer. Drag the cross pointer to move the window. As the cross moves, an outline of the window is displayed on the screen. When the outline is in the desired position, click once with the left mouse button and the window will move there. See Figure

The other method is easier and uses the drag and drop technique. Place the mouse pointer over the window's title area, hold down the left mouse button and drag the window to its new screen location. When the window is being moved, a pair of numbers is displayed on the screen. These are the x axis and y axis values. These numbers show the new position of the window on the workspace display. The number on the left represents the horizontal (X) position. The number on the right represents the vertical (Y) position. These numbers are useful to developers and programmers who want to have a window appear in the same position every time an application is invoked. See Figure

Minimizing and Restoring a Window 

At the top right side of the window is a Minimize button. Clicking this button converts the window into an icon. See Figure . By default, the icon of a minimized window is placed at the left edge of the workspace display. However, the icon can be moved to any desktop location by dragging it to the desired position. Only one click of the left button is required to change a window to an icon. To change the icon back into a window, double-click the icon with the left button. Click once on an icon invokes the window menu. Select Restore to change the icon back into a window. See Figure

Note: When a window occupies all of the workspace display, no other windows can be seen, because they are covered up. To switch to another window, either lower the full display window or reduce it to its previous size. Use the F9 and F10 function keys with the Alt key as keyboard alternatives to using the mouse.

Maximizing a Window 

To make a window fill the entire workspace display, left click the box button at the top right side of the window. See Figure . To reduce the full display window to its previous window size, select the box button again. When the window is reduced to its previous size, it is placed in its previous display position on the workspace.

The Minimize and Maximize buttons are shown in Figure , along with the window menu equivalents.

Closing a Window 

To close a window, double click on the dash in the upper left corner of the window with the left mouse button. See Figure . Windows can also be closed with a single click of the left mouse button. In the upper left corner, select the Close option from the menu that is displayed. UNIX will prompt the user to save information if closing the window may cause unsaved data to be lost. See Figure . The keyboard alternative to close a window is Alt+F4. Most applications will prompt a confirmation for closure of a window that contains unsaved data.

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.4 Locking the display
Left click the Display Lock button on the front panel to lock the screen. The backdrop will be blank, by default, and the Password Prompt box will be displayed for a short time. Move the mouse or press a key on the keyboard, to redisplay the password prompt. A locked display can be unlocked only by entering the correct password for the user who locked the screen. See Figures and

Note: If a user locks the display and forgets the password, the root user can enter the root password to unlock the display. The Style Manager, discussed later, enables the user to choose a screensaver program while the display is locked.

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.5 Workspace management
Four workspaces are available when the first CDE session is started. See Figure . Additional workspaces can be created. Each takes up the whole display area of the screen. Click the right mouse button while the pointer is positioned over the workspace buttons area, to get a menu of options. See Figure . One option is to add a workspace. A limited menu will appear if the pointer is positioned over the area between the workspace buttons instead of over the button itself. When a new workspace is added, it is given the name New.

The name of a workspace can be changed by either of the following two methods:

  • Choose the Workspace Buttons menu option Rename. See Figure .
  • Double click the workspace name in the central area of the front panel display.

Do not give the workspace a name that is too long to be fully displayed. When the name is too long for the display, only the left most characters will be displayed in the front panel display area.

Workspaces can be deleted from the front panel area by using the Delete option in the Workspace Buttons menu.

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.6 Minimizing and maximizing the front panel
Click the Minimize button at the top right corner of the front panel window to minimize the front panel. See Figure . The resulting icon shows the name of the current workspace immediately below it. To restore the front panel display, double click the minimized Front Panel icon. See Figure . If the icon is hidden behind another window, lower the overlapping windows until the Front Panel icon can been seen or press the Alt+Tab keys until the Front Panel icon is brought to the front of the overlapping windows displayed on the screen.

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.7 The workspace menu
The Workspace menu provides easy mouse access to all applications, tools, and files through cascading submenus. See the figure. To display the menu, move the pointer to the backdrop and press the right mouse button.

Note: The Workspace menu on the system might look different than the picture in the figure.

Lab Activity
  Becoming Familiar with CDE

In this lab, the student will work with the standard graphical user interface (GUI) for most commercial versions of UNIX known as Common Desktop Environment (CDE). The student will become familiar with the front panel and use the mouse and keyboard to manage windows. The student will also practice locking the display, moving between workspaces, and using the Workspace menu.

 

2.2 Becoming Familiar with the Common Desktop Environment
2.2.8 Introduction to the CDE tutorial
Sun Solaris CDE provides a basic tutorial for users new to the CDE desktop. To access the tutorial, click the Help subpanel menu and then click Desktop Introduction. This allows the student to choose from the following topics:
  • Basic Desktop Skills
  • The Desktop at a Glance
  • How to get Help
  • Keyboard shortcuts for the desktop
  • Glossary

 

2.3 Customizing a Workspace with the CDE Style Manager
2.3.1 Using style manager options
The Style Manager enables the user to customize the following workspace attributes (See Figure ):
  • Color sets the color attributes of the windows and the workspace background. 
  • Font sets the size of the font display in points. 
  • Backdrop sets the workspace backdrop display. 
  • Keyboard sets key click and key repeat characteristics. 
  • Mouse sets mouse button positions, acceleration, and threshold values.
  • Beep sets the tone and duration of the beep.
  • Screen sets screen blanking characteristics and background lock programs. 
  • Window sets the behavior controls for windows and icons. 
  • Startup sets the logout and CDE session startup controls.

Color

The color controls enable the user to select a color system for the backdrop, window borders, windowpane, and menu areas of the display. See Figure . Each display is set to a color based on the palette chosen from the list. After the palette is chosen, it can be modified to suit the user's needs by clicking Modify. Color changes will apply to all workspaces.

Font

Changing the font size alters the display character size of the next and subsequent windows opened. The text size in the Help Viewer documents is not affected by changing font size. Different font sets can be added to the list of Font Groups by clicking the Add button. The Attributes button enables the user to choose alternate character sets. See Figure .

Backdrop

The Backdrop choice enables the user to change the background for the current workspace. See Figure . Color choices that are made will also affect of the backdrop appearance. Each workspace can have a different backdrop applied to it.

Keyboard

The keyboard controls enable the user to turn keys repeating on and off. To have the keys make a sound when they are pressed, adjust the click volume to be as loud as possible. If the value is set to 0, the key click is effectively turned off. If any changes have been made to the settings, selecting the Default button restores the values to those shown in Figure .

Mouse

Changing the left or right handedness of the mouse reverses mouse buttons 1 and 3. Button 2 can be used to select text or objects to Adjust. Button 2 can also be used to drag and drop objects to Transfer. Select Adjust for the transfer actions. Drag will require the use of mouse button 1. The maximum time between clicks of a double click can be adjusted. Changes to this will become effective with a new login session. Acceleration changes how fast the mouse pointer moves across the display. Threshold determines the distance in pixels that the pointer moves at slow speed before moving at the accelerated rate. See Figure .

Beep

The volume of the beep noise can be set to a value between 0 and 100. A 0 setting for the beep noise effectively turns it off. Tone determines the pitch of the beep, from 82 to 9000 Hertz (Hz). The duration of the beep noise can be set to last up to 2.5 seconds. See Figure .

Screen

The Screen controls enable the user to designate which screen saver program will run when the workstation display is locked. The user can designate a number of screen savers to run, in succession, and have each of them run for a period between 0 and 120 minutes. The user also can set the period of screen inactivity at which the screen saver will automatically be invoked. See Figure .

Window

The Window control allows the user to designate how windows and icons can be manipulated. See Figure .

Startup

Set the home session to save the current work session window as the default window to open when the next home session is started. Choose Set Home Session and it will override any previously saved information. The user can choose to return to the current session as it was when logging out, or to the home session when logging back in. Turn off the Logout Confirmation Dialog option and the user will automatically be logged out when the Exit button is selected, without any further confirmation being requested. If the Logout Confirmation Dialog option is set to On, the user will be asked to confirm that they do want to log out when they choose to exit. When the user starts their next work session, the data contained in any windows will be gone or be set to default values. See Figure .

 

2.4 Working with Subpanels
2.4.1
Adding and removing applications with subpanels

The subpanels, or pull up menus, located on the front panel enable the user to add desired applications for easier access. The user can add and delete new action buttons for launching their most frequently used applications or scripts. See Figure .

Adding Applications Icons

Add applications to the subpanel menu list by dragging the appropriate icon from the Application Manager window display and dropping it on the Install Icon area of the subpanel. Click on the Applications icon on the Applications subpanel to find many frequently used applications. 

Place the most frequently used icons on the front panel display by clicking the Promote to Front Panel choice in the menu of options. This speeds up access to the most commonly used programs and helps reduce the need to open subpanel lists.

Removing Applications Icons

Right click the desired icon to manipulate the icon on a subpanel or delete it from the subpanel. This displays a menu of options relating to the icon. See Figure . Subpanels can be placed on the workspace by using the same method that was used to move a window.

2.4 Working with Subpanels
2.4.2 Application manager
The Application Manager window contains six folders as shown in Figure . Open the desktop folders to see icons that can be added to a subpanel. To achieve this, drag and drop the desired icon on the Install Icon area if the subpanel. Add the icon to the subpanel and that application can be invoked from the subpanel itself. Icons also can be added to the front panel by right clicking a blank area of the front panel and then clicking Add Icon.

Note: An application icon can be placed on the workspace display in the same way. The application is then available directly from the workspace. The System_Admin folder contains icons that are useful for system administrators. The OpenWindows folder contains icons that can be used to open OpenWindows programs while working in a CDE environment.

Lab Activity
  Customizing the Workspace

In this lab, the student will work with CDE Style Manager, Application Manager, subpanel menus, front panel, and the desktop to customize their workspace environment.

 

 

2.5 Using GNOME and KDE in Linux
2.5.1 Overview
Most distributions of the Linux operating system offer a choice of graphical user interfaces. The two most popular desktop managers are GNOME (GNU Network Object Model Environment) and KDE (K Desktop Environment). Each offers a collection of applications and software tools that have been customized to work with its respective desktop control features. Both GNOME and KDE are easy to use and configurable. 

Most GNOME enabled and KDE enabled software, that is normally launched from menus and panel buttons, can run apart from either desktop manager. In GNOME there is a submenu that leads to the KDE menus. Select items from this menu to start them under GNOME. The items work fine, but without some of the more subtle integrative features of KDE. It is also possible to access most of the GNOME applications from the KDE menu. 

The question of which desktop manager to use is a matter of personal preference. The user may install both desktop managers if enough disk space is available. The user would have the choice of either one when logging in. Both GNOME and KDE are widely supported. 

A future release of Solaris GNOME will become the default desktop. However, CDE will remain as an option allowing users to choose either environment when they log in. GNOME for Solaris can be downloaded from www.sun.com/software/gnome.

Note: In the following sections the student will be introduced to both GNOME and KDE. However, after this chapter, discussions on topics dealing with the graphical user interface under Linux will center on GNOME with Sawfish as the window manager, as delivered with the Red Hat distribution of Linux.

 

2.5 Using GNOME and KDE in Linux
2.5.2 Choosing the login session
When Red Hat Linux boots and starts graphics, its login window looks like the screen shown in the figure.

At the top of the login box is a series of labels that produce drop down menus. First, if the choice of language required is not English, select the language preferred from the Language menu.

The Session menu has choices labeled Last, the default, Failsafe, Default, GNOME, and KDE.

  • Last uses whatever login environment selected the last time the user logged in.
  • The Default will be GNOME when the user has never logged in before and made no selection.
  • The user can designate either GNOME or KDE if both are installed. If the choice made is not the user's normal default, a window will appear offering to let them make it the default.
  • On occasion users make mistakes in configuring their login environments that prevent them from being able to login. As a defense against locking oneself out, the Failsafe session logs the user into a terminal window, without attempting to evaluate any startup files.

 

2.5 Using GNOME and KDE in Linux
2.5.3 Primary differences between GNOME and KDE
The purpose and overall functionality of GNOME and KDE are similar. However, their underlying basic architectures, technologies, and accompanying applications and tools are quite different. The figure shows the GNOME and KDE icons. 

The differences in the look, feel, and style of operation of the two user interface systems are covered in the following paragraphs. Users interested in exploring an in depth comparison can find a comprehensive summary at http://linux.web.cern.ch/linux/ redhat6/gnome/gnome_kde/

General Differences

GNOME is inarguably more flexible than KDE, and easier to configure. KDE has been around longer, and quite a few KDE compliant applications exist.

Window Managers

KDE uses a single carefully integrated window manager. 

GNOME allows selection from a variety of window managers. The default window manager, presently best supported by GNOME, is Sawfish. Sawfish is programmable and extensible in a dialect of Lisp called librep. Other window managers such as Enlightenment, FVWM2, IceWM, and TWM are available in Linux distributions, and work fine under GNOME. However, they are less tightly integrated with GNOME.

Virtual Desktops

KDE allows a limit of eight virtual desktops, also known as workspaces. Each virtual desktop can have its own background and look. The default number of workspaces available with KDE is four.

In GNOME the number of virtual desktops allowed is a function of the window manager selected. There is no limit to the number under Sawfish, except the limitation of the system memory. Sawfish allows subdividing each workspace into a grid, with a user definable number of columns and rows of viewports. All workspaces and viewports inherit the same background and appearance. As with KDE, the default number of workspaces available with GNOME is four.

Panels

Panels are like the taskbar in Windows. Panels are a place to locate menus, launch programs, and store buttons and icons that serve many purposes. GNOME allows the creation, deletion, moving around, and complete customization of any number of panels. Types of these panels are: 

  • Menu 
  • Edge 
  • Aligned 
  • Sliding 
  • Floating 
  • Drawer, as a special type of panel within a panel 

KDE's implementation of panels is limited to one main panel and a taskbar.

File Managers

KDE's primary means of managing files is with Konqueror, which has been compared to Microsoft's Internet Explorer 4.0. Konqueror doubles as a browser, although it does not support any of the popular plugins used by Mozilla, Netscape, and Explorer. Explorer is also not available for Linux.

GNOME's Nautilus is a graphical shell that enables users to explore files and also browse the Internet. Like Konqueror, Nautilus does not support plugins. However, a variety of browsers are available for Linux that do use plugins. Mozilla, the open source version of Netscape, is now supplied as the default browser under GNOME, and may be run from KDE as well.

Also note that many veteran users of UNIX and Linux systems prefer to use a terminal window and traditional UNIX shell based commands to manage files.

Themes

Themes make integrated visual and functional changes to the desktop. Theme support under KDE is excellent, and includes a theme manager. GNOME theme support is even better. Using the Sawfish window manager it is possible to define separate themes for individual windows and groups of windows.

Control Center

Both KDE and GNOME enable configuration through well designed graphical programs.

 
2.5 Using GNOME and KDE in Linux
2.5.4 Introduction to GNOME and KDE tutorials
Instruction is readily available in both GNOME and KDE. The abundance of information can seem confusing to new users, but the documentation is generally well indexed and quite readable.

Learning about GNOME

Logging in under GNOME for the first time, users are presented with a screen that looks like that in Figure . The large window is the Nautilus graphical shell.

There are several ways to start learning about GNOME.

  1. On the panel at the bottom of the page is an icon with a question mark inside a cartoon dialog balloon as shown in Figure .

Click on the documentation icon to bring up another Nautilus window with the GNOME HELP INDEX displayed. Below the title is a link that says GNOME User's Guide. Open the user's guide to go to the table of contents. Begin reading about GNOME in the table of contents.

  1. Click the Help tab on the bottom left of the sidebar in the Nautilus window. This opens an index to several help documents, including the GNOME User's Guide, and an Introduction to GNOME as shown in Figure . To locate detailed information on any subtopic click on the expansion arrow to the left of any subject.
  2. Help on Nautilus may also be accessed from the Help menus located at the top.

Learning about KDE

The documentation icon on the KDE toolbar is a red and white striped life preserver, located fifth from the left in Figure .

Click on the icon to access the KDE Help Center. Notice the index in the sidebar on the left. This may be used to help find information on specific topics of interest. A book icon titled Tutorial provides an explanation of icons and an introduction to the KDE desktop. See Figure .

 

2.6 GNOME Customization
2.6.1 User preferences

GNOME and its window managers are infinitely configurable. To customize the most visible elements of GNOME's environment is simple and functions much the same as with other graphical user interfaces, such as Windows or CDE. These elements include screen backgrounds, choices of colors and fonts, themes and screensaver behavior. Start Nautilus from the Start Here icon, select the Preferences icon, followed by the subgroup of options that the user would like to change. See Figure . Continue to follow the guidance that is given on screen.

 

2.6 GNOME Customization
2.6.2 Adding to the GNOME panel
Configuring the GNOME panel is simple. The user may add objects of various types to panels. These types include launchers, applets, menus, and drawers. Click the GNOME foot icon to bring up the main menus. Then select Panel, followed by Add to Panel to see a submenu that will list all of the object types that may be added. 

In addition to adding objects to panels, the user may add panels of various types. We will show the student how to add a launcher, an applet, a drawer, and how to create a new panel.

Adding a launcher to the GNOME panel

A launcher starts an application when its icon is clicked. For example, to add the GNOME CD player to the panel, click on the GNOME foot icon and select Panel, then click Add to panel, Launcher from menu, Multimedia, and finally CD Player. The CD player icon will appear on the panel. The player will appear when its icon is clicked. See Figure .

To add a launcher for something that is not in the menus, start as above, then select Launcher. A dialog box asks for specifics. The user may select an icon to use by clicking on the blank box labeled No Icon. If no icon is selected, GNOME will insert a default placeholder.

Adding an applet to the GNOME panel

An applet is a small application that runs from within the panel, such as a clock or mail notification utility. 

To add an applet that monitors system CPU and memory use, click the GNOME foot icon and select Panel, Applets, Monitors, and finally CPU/MEM usage. The applet appears in the panel, and continues to update while the system is being used. 

In this case the user did not need to select Add to panel, because an applet by definition runs in the panel. Selecting an applet causes it to be installed in the panel automatically.

Adding and filling a drawer on the GNOME panel

A drawer is a collapsible panel within a panel. To add a drawer to the main panel, select the GNOME foot, then Panel, Add to panel, and finally Drawer. A drawer icon appears on the panel with a small open arrow on the upper right. 

Click once on the drawer and an empty panel will appear. Any sort of panel object may be added the same way an object was added to the main panel. 

To close or reopen the drawer, click on the drawer icon or the arrow at the end of the opened panel.

Figure shows an opened drawer on the main panel. Shown from the top are: 

  • A menu 
  • A screen lock button 
  • A log out button 
  • A run button 
  • A launcher for GNU Emacs 
  • Another drawer opened to reveal system toys and games 
  • A final drawer opened to reveal several system resource monitor applets

Creating a floating panel

The various panel types feature subtle differences in the way they are placed on the desktop, but are otherwise much the same. Here we show a simple example of how to create a floating panel. 

The student may add any number of panels to their desktop. We suggest that when the student has time to explore them, to create one of each type in order to learn their differences and to find what best suits their own requirements.

To create a floating panel:

  1. Click the GNOME foot icon and select Panel, Create panel, and finally Floating panel. An empty, vertically oriented panel with open and close arrows appears at the top left of the screen. 
  2. Press the right mouse button on either arrow and select Panel, Properties, and All properties. The Panel properties window appears. Options may be customized such as the panel's size, orientation, position, and background. Unlike other property setting windows, these properties apply as they are typed in. There are no Apply, OK, or Cancel buttons. 
  3. Click Close when finished with customizing the panel.

Figure shows the top left part of a screen where a panel has been created, with the Panel properties window still open. Note that the panel's orientation has been changed to horizontal. The top left corner has been relocated so it does not overlap desktop icons, and the background color has been set. An applet toy was added to give the panel some content.

Further Panel Customization

Objects on panels may be moved, configured, or deleted. These operations are all initiated by pressing the right mouse button with the pointer over the panel object. This will bring up a menu.

To move objects, such as a desk guide or a task list, the pointer must be over the object's handle. Select Move from the menu and drag the icon to the position wanted. The icon may be moved to another open panel. Other icons automatically move over to make room for it.

Objects that are configurable show a Properties submenu. Details concerning the object's use may be added. This feature may also be used to select a custom icon for a program.

Lab Activity
  Exploring GNOME

In this lab the student will become familiar with the GNOME desktop management environment. The student will use the Nautilus graphical shell to find their way around the system, and to customize GNOME according to the student’s preferences. The student will also learn to use the menus and launchers in the panel, how to modify what is in the panel, and how to add panels of their own.

 

2.6 GNOME Customization
2.6.3 Adding to the GNOME menus
GNOME allows its menu system to be customized. Menu items may be added, deleted, reordered, and restructured. However, unless the student is logged in as the superuser, or root, the only menu that may change is the Favorites menu. This happens because changes made to the other GNOME menus affect all users on the system.

Adding to Favorites from another menu

Sometimes an item that is used frequently is nested deep within the menu structure. This requires the user to search for it every time. The user can add this item to their Favorites menu. As an example, to add the KDE version of the game Mahjongg perform the following steps:

  • Click on the GNOME foot menu
  • Select Favorites
  • Select Add from menu
  • Select KDE menus
  • Select Games
  • Select Boardgames
  • Select Mahjongg 

The game will be duplicated on the Favorites menu.

Adding to Favorites using the menu editor

Click the GNOME foot icon, then Panel, and finally Edit menus, to start the menu editor. The student should remember that the only part of the menu system that they can change as user is the Favorites menu.

As shown on Figure there are buttons that allow the student to create new submenus, add menu items, delete items, and to organize labels in a menu by moving the labels up or down, or by sorting them alphabetically.

To add a new item, press the New Item button. The item is added as untitled with the name highlighted. This is just a label. We will use the GNOME version of the game Mahjongg as an example.

  1. In the Name box type "Mahjongg".
  2. In the Comment box type "GNOME Mahjongg game".
  3. In the Command box type /usr/bin/mahjongg
  4. Click the blank icon, labeled No icon. This opens another window with a display of icons in the directory /usr/share/pixmaps.
  5. Scroll down and find gnome-mahjongg.png and click on it, then click on OK.
  6. Click Save at the bottom of the menu editor. The item added will now appear as a selection in Favorites.

The student's input should match what is shown in Figure .

 

  Summary

Two types of accounts exist on a UNIX system. The root account has access to the entire system and can perform system administration tasks such as creating new users, setting up printers, and installing software. All other users have a regular user account to access applications and personal files.

User accounts and passwords have specific rules that must be adhered to. These include minimum and maximum length and which characters they can contain. Users can change their passwords at the command line with the passwd command. Password rules do not apply to the root account for Solaris.

The student can log in via GUI, from the command line, or using a Telnet program with a valid username and password. The student must log out or exit the system properly before shutting it off. The init and shutdown commands are used to properly shutdown a UNIX system.

All current versions of UNIX provide a graphical desktop with a front panel, which is the main user interface. The student should be familiar with the front panel arrangements of both CDE and GNOME and should know the buttons and options available.

The mouse and keyboard on a Sun workstation are different than those of a typical PC. The Sun keyboard has extra keys, and the mouse has three buttons instead of two, as with the PC mouse. The student should be familiar with the functions of the left and right mouse buttons.

The GUI desktop environment allows the student to manage their windows by changing their location, size, and position relative to other windows. CDE provides up to four workspaces, which are separate desktop environments. The front panel includes a button for locking the workstation and buttons for changing between workspaces.

The student can use CDE Style Manager to customize each of their workspaces by changing items such as colors, fonts, screen savers, mouse settings, and keyboard settings. CDE Subpanels are pull up or pull down menus that provide access to many desktop applications. The student can add or remove icons or applications with subpanels.

GNOME and KDE are two graphical desktop packages that are popular with Linux. Most distributions come with one or both. GNOME can also run on Solaris and will be the default desktop in a future OS release. As with CDE, GNOME can be customized with user preferences and by adding applications to panels and menus.

 

  Overview
This chapter introduces the student to several useful applications that are included with CDE (Common Desktop Environment). The student will work with the Mail Tool to view and manage e-mail messages, and they will use the Calendar Manager to manage dates and appointments. CDE contains many other useful applications, such as Voice Notes and Text Notes, Address Manager, Audio, Icon Editor, Image Viewer, Snapshot, Calculator, and Clock. These applications and the use of a Terminal window in CDE are covered in this chapter. An overview of graphical applications that are available with GNOME (GNU Network Object Model Environment) and KDE (K Desktop Environment) is also provided.

 

3.1 Using the CDE Mail Tool
3.1.1 Introduction to mail tool
Overview 

Mail Tool is a full-featured graphical e-mail management program. The Mail Tool is an e-mail client that is a standard component of the Solaris CDE. With Mail Tool, the user can perform all normal functions related to their email. The user can read mail and attachments, create new mail with attachments, and delete and manage their email. 

Mail Tool's features include spell checking, message drafting, and template capabilities. It supports both the Post Office Protocol (POP3) and Internet Message Access Protocol (IMAP). Mail Tool saves copies of outgoing messages, creates views for reading selected mail messages, supports aliases, and handles vacation automessages. 

The Mail icon 

A Mail icon appears on the front panel of the CDE. The user clicks the Mail icon to start the Mail Tool program to read and work with their e-mail. When they receive a new email, the icon changes slightly to alert them of new mail. See Figure .

The Mail Window 

By default, the Mail window is divided into two areas, as shown in Figure . The upper portion displays a list of the e-mail messages that have been received. The lower portion displays the text content of the currently highlighted message. This enables the user to view each message's content by clicking once on an e-mail's subject line. Click the Control button between the upper and lower portions of the screen window and drag it down or up to change the size of the message viewing area.

New Messages 

When the user has a new, or unread message, the letter N appears to the left of the sender's name in the top portion of the Mail window. See Figure . After the user opens the new message, the N disappears to indicate that the message is no longer new.

Attached Files 

When an e-mail message contains attached files, a diamond shaped character is displayed after the new message indicator (the letter N). To read an attachment, double click its icon at the bottom of the window. See Figure .

 

3.1 Using the CDE Mail Tool
3.1.2 Composing new email messages
The user can compose a new mail message by clicking Compose, New Message from the main menu, as shown in Figure . A window appears where the user can fill in the appropriate information. The address for the message must be complete. The user can include more than one name, separated by commas, in the To: and CC: fields. After the message is created, click the Send button in the bottom left corner of the pane to send the message to the addressee(s). See Figure .

e-mail Addressing

As with regular mail, the user will need to specify the address of the person(s) to whom the e-mail is being sent. If the message is sent to someone whose computer is on the same local area network (LAN) as the users, use the address username@hostname. For example, to mail a message to user05 on a computer named buckeye, enter user05@buckeye in the To: field. To send Internet mail to someone outside the user's institution or company, the following format must be used to address the email:

bjoy@institution.com

Below is a breakdown of this format:

  • Username (bjoy) - is usually a combination of the letters of a person's first and last name.
  • The "at" symbol (@) separates the username from the rest of the e-mail address.
  • Domain name (institution.com) is a unique, registered name; usually a company or Internet service provider (ISP) name followed by a "dot" (.) and then a domain name extension that determines the organization type. (For example: .com means a company in the commercial domain, .edu represents the education domain, .mil stands for military, and so on.)

Adding Attachments

Click the Attachments option from the New Message screen menu to attach a file to the composed message, as shown in Figure . Click Add File, and a window appears from which the user can choose the file that is to be attached.

Note: The user can also drag a file from the File Manager into the Attachment area in the bottom of the Compose window.

 

3.1 Using the CDE Mail Tool
3.1.3 Responding to received messages
To reply to a received message, open the Compose menu to see the options, as shown in Figure . The user is given the choice of replying to the sender or replying to all recipients of the message. The user is also given a choice of including the original message.

Mail typically is sent out in a mass mailing to many recipients who happen to be on a mail alias. Mail aliases are often large and general, so use the Reply to All option with caution. The user can reply and include the message that they received. They can bypass the Compose menu and click the Reply, Include Message icon on the toolbar of the Mail Tool. After the user chooses a method of reply, a window appears so that they can type their response. See Figure . By default, the original Subject text is used, preceded by Re: (Regarding). The To: entry is automatically set to the email address of the original sender of the message.

 

3.1 Using the CDE Mail Tool
3.1.4 Deleting mail messages

Deleting Mail
To keep the list of received mail messages to a minimum (and to save disk space), users should periodically delete mail messages. There are a number of delete options. See Figure . Choosing to delete the mail messages does not remove the mail. Rather, the messages are stored until the mail window is closed. This gives a user an opportunity to decide not to delete the message. Users can force the mail program to delete any mail messages which were previously selected for deletion by clicking on Mailbox and then Destroy Deleted Messages.

Undeleting Mail
While users continue to work with the mail program, a list of the deleted mail messages is available. The user can undelete one or more messages from the list. See Figure . When a message is undeleted, it will reappear in the list of received mail messages.

3.1 Using the CDE Mail Tool
3.1.5 Mail tool options menu
The Mail Tool Options menu enables the user to create distribution lists and signatures, and it also gives the user many other useful tools.

Alias Option

e-mail addresses can be difficult to remember. Mail Tool provides a utility that enables the user to set up aliases for either a particular person or a group of people that they frequently send mail to. A mail alias is similar to a group or distribution list with other mail systems. Clicking Options and then Aliases, as shown in Figures and , can access this utility. Choose a name for the alias, and enter the e-mail addresses of all users that are to be part of the alias, separated by commas. After an alias has been entered, click Add to place it in the list of aliases. When finished creating aliases, click OK.

Creating and Using a Signature

A signature is text that the user can include with each mail message that they send. A typical signature includes the user's name, institution or company, phone number, email address, and Web site. Signatures appear at the bottom of the message.

To create a signature, choose Signature from the Options menu, and then enter the signature text in the Signature text area.

To include the user's signature in a specific message, or all messages, choose Include Signature from the Format menu of the Compose window.

Other Customizable Options

Many other options can be customized with the different categories listed under the Options menu. Some of these include the following:

  • Saving copies of mail sent
  • Specifying how often the system is to check for new mail
  • Specifying how to be notified of new mail
  • Setting a vacation message to be sent in reply to messages when the user is unavailable
  • Creating a custom signature that can be attached to all outgoing email

 

3 3.1 Using the CDE Mail Tool
3.1.6 Creating alternate mailboxes
Messages that the user receives can contain information that they may want to access at a later time. In the CDE Mail Tool, the user can create multiple mailboxes for the purpose of storing mail for later retrieval and organization. See Figure . These mailboxes can be named to reflect the contents that the user intends to store in them. See Figure . After a new mailbox is created, the user can use the Move menu to move received mail into it and save it for future reference, as shown in Figure .

 

Lab Activity
  Using CDE Mail Tool

In this lab, the student will work with the CDE Mail Tool, also known as Mailer. Mail Tool is a full-featured graphical e-mail management program.

 

3.1 Using the CDE Mail Tool
3.1.7 The Netscape Mail alternative
The CDE Mailer program has many advantages. It is integrated with other CDE tools and applications, aliases, vacation automessage capability, and so on. However, it also has the following disadvantages:
  • It cannot attach multiple files simultaneously.
  • It cannot choose addresses from an option list.
  • It cannot create nested mailboxes easily; this must be done manually by creating a new directory using the mkdir (make directory) command or using the CDE File Manager program.
  • Some files can be too large to mail.

As an alternative, some users choose to set up and use the Netscape Mail program that is built into Netscape Communicator and loaded on a Solaris system along with the CDE. Microsoft has not developed a UNIX version of Internet Explorer. Netscape is also included in most distributions of Linux. If Netscape Communicator is not on the user's system, they can download it for free from http://www.netscape.com/. The Figure shows the Netscape Mail screen.

 

3.1 Using the CDE Mail Tool
3.1.8 Non windows based mail programs
Sometimes a user may be working on a UNIX system without the availability of a graphical interface. This happens because it was set up that way (user preference) or because the user used the Telnet program to access the system. If the user cannot access the CDE mailer or Netscape mail, what can be done?

Fortunately, text based and menu based mail programs can be run from the command line. The two most popular programs are the following:

mailx (and the earlier, more basic mail program) - This program comes with every version of UNIX and is an acceptable program for reading and sending mail. The mailx program basics are found in Appendix E, mailx. This program is worth learning for those times when the user needs a mail program but does not have access to CDE.

Pine - This program is menu based and easier to use than the mailx program. Typing pine at the command prompt can access pine. Pine is installed by default with Linux but not with Solaris. It is available on the Solaris Software Companion CD and can also be downloaded from http://wwws.sun.com/software/solaris/freeware/.

The figure displays Pine's main menu with the list of one-letter commands that can be chosen by either typing the letter or using the arrow keys and pressing Enter.

Tip: The mailx program was designed for sending text only messages, not for sending programs, formatted application files, or image attachments. If the user needs to send a non-text attachment, they will need to use the uuencode command to convert the file to text for attaching and sending. If the user is receiving an attachment using mailx, they will have to use the uudecode command on the detached file to use it. See the UNIX manual pages (man pages) for additional information. The use of man pages is covered in Chapter 4, "Getting Help".

 

3.2 Using CDE Calendar Manager
3.2.1 Introduction to calendar manager
Calendar Manager is a full-featured graphical schedule and appointment management program. It is a standard component of the Solaris CDE. With Calendar Manager, the user can perform all normal scheduling functions and share their calendar with others. The user also can set meetings on other people's calendars.

Calendar Manager Window

To start Calendar Manager, click the Calendar icon on the CDE Front Panel. By default, the Calendar window displays a month view of the calendar. The view can be changed by clicking one of the four view icons at the top right side of the Calendar Manager window, as shown in the Figure.

 

3.2 Using CDE Calendar Manager
3.2.2 Viewing the calendar
The user can view the calendar in several different formats. Any of the following viewing formats can be selected with the icons on the Calendar Manager window:

The Day view of the calendar is shown in Figure . It can be selected by clicking the icon that is highlighted in the upper right corner of the screenshot.

The Week view of the calendar is shown in Figure . It can be selected by clicking the icon that is highlighted in the upper right corner of the screenshot.

The Month view of the calendar is shown in Figure . It can be selected by clicking the icon that is highlighted in the upper right corner of the screenshot.

The Year view of the calendar is shown in Figure . It can be selected by clicking the icon that is highlighted in the upper right corner of the screenshot.

 

3.2 Using CDE Calendar Manager
3.2.3 Setting calendar options
By setting the calendar options, the user can customize their calendar by adjusting the display, print, and date settings. The user also can add appointments.

Calendar Editor Defaults

The File, Options menu option displays the calendar Editor Defaults window by default. See Figure . In the Editor Defaults window, the user can set the options to suit their personal preferences. See Figure . After the values are modified, click either OK or Apply to save the updated details. Selecting the appropriate choice from the drop down menu can set other Options settings, as shown in Figure .

Display Settings

In Display Settings  (See Figure ), the user can do the following:

  • Set the time range for the working day
  • Set the hour display as 12 or 24 hour
  • Designate the default view for the Calendar Manager
  • Designate the default calendar to view

Printer Settings

The Printer Settings window enables the user to set their personal options for the printing of calendar appointments. See Figure .

Date Format

The Date Format window enables the user to set the format for date, display, and date entry. See Figure .

 

3.2 Using CDE Calendar Manager
3.2.4 Working with appointments
Appointments or things to do can be added to the user's calendar by clicking the appropriate icon at the top-left side of the window. See Figure .

Adding an Appointment 

Click the Appointment button and an Appointment Editor window is displayed. See Figure . Following are details that can be entered into this window: 

  • The date on which the appointment is to be made 
  • The start and end times of the appointment 
  • Details relating to the appointment (in the What box)

After the appropriate details are selected or entered into the relevant window areas, click Insert to add that appointment. When an appointment has been inserted, it will be displayed in the Time What area at the right side of the window and on the appropriate day of the user's calendar. The Drag Appointment icon can be used to drag an "appointment by email" onto the user's calendar.

Setting Start and End Times 

Pick and point lists are provided to indicate the times that the user's appointments start and end. These lists can be selected by clicking the appropriate time box to the right of the start and end times. 

Note: By default, the user can add several appointments on the same day to start at the same time. The Calendar Manager does not warn the user of conflicting appointments.

Selecting a Date 

Regardless of the current view of the calendar, the user can scroll forward and backward along a timescale associated with that view. After an appropriate date is visible on the display, the user can open the Appointments Editor by double clicking the area in the window associated with that day. If the user is looking at the weekly view, they click the area at the bottom left of the window, and then double click in the hourly section to set an appointment for that time, as shown in Figure .

Appointment Editor Options 

Additional options are available when adding an appointment. See Figure . By clicking More in the lower left corner of the window, this display opens at the bottom of the Appointment Editor window. The following options are available: 

  • Frequency of the appointment 
  • Number of times that a frequent appointment is to be added to the calendar 
  • Privacy controls 
  • Appointment reminders 
  • Who to send e-mail to (when an appointment reminder is to be sent) 

To close the additional options window area, click Less.

Finding Appointments 

The Find window enables the user to search for text in the appointment entries. See Figure . The user can specify the time period to search, giving a start and end date. After appointments are found, they can double click the details (shown in the lower portion of the window) to view the actual appointment details. 

Tip: If someone sends an email with an Appointment icon, the user can drag the icon to an open calendar window or to the Calendar control on the Front Panel, to add it to his or her calendar. The Appointment icon cannot be dropped on a minimized calendar.

 

3.2 Using CDE Calendar Manager
3.2.5 Working with other users' calendars
Setting Access to the Calendar
In this window, a user can set the access rights for the calendar. See Figure Users can designate who has the right to work with or view the calendar. By default, this is set to world, which means that everyone has access rights.

Browsing Other Calendars
If a user wants to check the appointments which have been made in other user's calendars, use the Browse, Show Other Calendar menu option. See Figure With the correct permission settings to view other calendars, a user can compare people's appointments to help arrange meetings which do not conflict with existing appointments. The Browse menu option also provides a menu editor for configuring the menu options which are used by the Calendar window.
Lab Activity
  Using CDE Calendar Manager

In this lab, the student will work with CDE Calendar Manager. Calendar Manager is a full-featured graphical schedule and appointment management program.

 

3.3 Other Built-in CDE Applications
3.3.1 Voice and text note applications
CDE provides a number of other useful applications for managing notes and addresses, tools for playing sounds, tools for viewing images, and a simple calculator.

Voice Notes

The Voice Notes application lets the user personalize their mail messages. Select Voice Note from the Applications subpanel to record voice input. See Figure . Note that selecting Voice Note starts Audio in record mode. A microphone or voice input device is necessary for this application to work. See Figure .

Text Notes

Text Notes enable the user to create "sticky notes" - style notes on their workspace. Select Text Note from the Applications subpanel to record text input. See Figures and . The note then can be minimized and left on the user's workspace as a reminder. The user can drag notes into mail messages as mail attachments.

 

3.3 Other Built-in CDE Applications
3.3.2 Address manager
Address Manager enables the user to search corporate name databases and organize their contacts in electronic cards. The user can schedule appointments, send email, and dial telephone numbers from the electronic cards. The user can access the Address Manager in one of two ways. First, they can right click the desktop to bring up the Workspace menu and then select Cards/Address Manager, or they can access the Address Manager from the Front Panel/Cards subpanel. See Figures and .
3.3 Other Built-in CDE Applications
3.3.3 Audio tool
The Audio application provides a way to record and play sounds. A microphone is necessary to record sound files. Sound files can be played through the built in speakers on a Sun workstation. Solaris for Intel systems must have a supported sound card and speakers. To activate the Audio application, right click the desktop and choose Applications, then select Audio and Video.

Tip: Sample sound files are on Solaris systems in the /usr/demo/SOUND/sounds directory.

 

3.3 Other Built-in CDE Applications
3.3.4 Calculator
The Calculator provides an online tool for quick calculations. It includes a basic simple calculator function and a more sophisticated scientific calculator function. The user can place the calculator on their desktop to have it available whenever they need it. To activate the calculator, right click the desktop and select Calculator. See Figures and .

 

3.3 Other Built-in CDE Applications
3.3.5 Icon Editor, Image Viewer, and Snapshot
Icon Editor

The Icon Editor application is used to edit or create icon images associated with an application. To activate the Icon Editor, right click the desktop and choose Applications, Icon Editor. See Figure .

Tip: Sample image files are on Solaris systems in the /usr/openwin/share/images directory.

Image Viewer

The Image Viewer application is used to view and manipulate graphics images. To activate the Image Viewer, right click the desktop and choose Applications, Image Viewer. See Figure .

Snapshot

The Snapshot application is used to capture screen images into a file to be later inserted into a document. See Figure . Most images for this course were created with the Snapshot application. Snapshot supports the popular graphic file formats such as GIF, JPEG, PostScript, and TIFF. To activate the Snapshot, right click the desktop and choose Applications, then select Snapshot.

 

3.3 Other Built-in CDE Applications
3.3.6 Clock
The Clock provides a graphical method of viewing the time, date, and time zone. To activate the Clock, right click the desktop and choose Applications, OW Clock (Open Windows Clock). See Figures and

Note: The user must be logged in as root to change the date on a UNIX system. The Clock only views current time and date settings and cannot be used to change them.

Other Clock display properties include the following and can be changed by right clicking the Clock and choosing Properties:

  • A digital versus an analog display
  • A 12 hour or 24 hour display
  • An option to select whether seconds are displayed
  • An option to select the time zone
  • An option to set a stopwatch
  • An option to set an alarm

 

3.3 Other Built-in CDE Applications
3.3.7 Terminal windows
A Terminal window can be opened in the graphical environment to provide a command line interface to the system, as shown in Figure . Multiple Terminal windows can be open at the same time. Each Terminal window represents a new shell and displays a shell prompt waiting for user input.

Anything the user can do from the command line they can do from a Terminal window. The student will be working in a Terminal window throughout much of this course as they learn various UNIX commands and their functions.

Tip: The student can open an additional Terminal window anytime by entering the dtterm& (desktop terminal) command in an existing Terminal window. The ampersand (&) tells the shell program to run the dtterm command in the background and to return the shell prompt so that they can continue working in that Terminal window. To close a Terminal window, type exit or press Ctrl-D.

Interactive Media Activity (Flash, 101 kB)
  Terminal Windows

In this exercise the student will enter the UNIX date command. This activity will demonstrate how a command is entered from the command line. The date command is similar to the CDE Clock application the student learned previously.

Lab Activity
  Other Built-in CDE Applications

In this lab, the student will work with several additional user applications that are included with the Common Desktop Environment (CDE). These include: Voice and Text Notes, Address Manager, Calculator and Clock. The student will learn how to open a terminal window that will give them access to the UNIX command line.

 

 

 

3.4 GNOME and KDE Applications
3.4.1 Overview
The GNOME and KDE desktops both include many of the same types of applications that are found in CDE. The names of the applications may vary from one desktop operating environment to another, but they perform essentially the same function. These applications include mail clients, browsers, schedulers, file managers, text editors, and helpful utility applications known as applets. Many open source applets are included with GNOME and KDE. In some cases they are common to both environments. The student can frequently run GNOME applications from KDE menus and vice versa. This section will introduce some of the more useful GNOME and KDE applications and will provide a comparison to those of CDE.

 

3.4 GNOME and KDE Applications
3.4.2 Web browsers and mail clients
GNOME comes with the following three web browsers: 
  • Galeon 
  • Mozilla
  • Netscape

Netscape and Mozilla also have mail capabilities built in. Mozilla is the default GNOME browser but the GNOME Nautilus file manager also has web-browsing functionality. Netscape was covered previously under CDE mail and is widely used in Windows and Macintosh in addition to UNIX environments. Mozilla is an open source web browser that includes the following applications:

  • Navigator
  • Mail reader
  • Web page composer
  • Address book

These functions can be accessed from the Tasks menu or by using the buttons on the lower left corner of the screen. The Mozilla browser window is accessed by clicking the red Mozilla head icon on the panel shown in Figure . This figure also shows the browser while accessing the http://www.mozilla.org/ web site. KDE comes with the Konqueror web browser, which also serves as a file manager. It does not include an e-mail client, however. See Figure

 

3.4 GNOME and KDE Applications
3.4.3 Calendar managers
GNOME includes a basic calendar manager tool called Gnome Calendar and a time tracking tool called GTimeTracker. These are accessible by clicking the Programs and then the Applications menus in either GNOME or KDE. Figure shows the Calendar and TimeTracker windows. KDE also has a Calendar / Organizer tool known as KOrganizer. Both include a task list. See Figure .

 

3.4 GNOME and KDE Applications
3.4.4 GNOME and KDE programs
GNOME Applications Programs

Many open source applications and utilities are available from the main Programs menu. See Figure . The programs available will be determined by the standard installation routines and by which options the student chooses during installation. Not all applications and utilities will be available in all distributions. This section will focus on the Programs and Utilities Menus. The application submenu includes (See Figure ):

  • The Calendar
  • An Address book
  • The Gedit text editor
  • A Time tracking tool
  • The Nautilus file manager
  • A Gnumeric spreadsheet
  • The Emacs editor
  • A diagram editor

Sun's StarOffice is an application suite, which includes a Windows compatible Word processor, Spreadsheet, presentation software and so on, similar to MS office. StarOffice is included at no cost with some distributions of Linux such as Red Hat.

GNOME Utility programs

The following utility programs are included (See Figure ):

  • Gdict the gnome client for MIT dictionary server
  • A simple calculator 
  • A character map
  • gfloppy, a floppy disk formatter
  • font selector
  • Gnome search tool, which can be used to find files

Other GNOME Programs Menu Submenus

A number of other programs and utilities are available through the submenus of the Programs menu. Some of those programs are listed as follows:

  • The Games submenu contains several good games and the Graphics menu contains ImageMagick for editing graphics. The Internet menu contains Browsers such as Galeon, Netscape, and Mozilla, as well as dialup configuration options. Gaim is an AOL Instant Messenger client and gFTP is a graphical FTP file transfer utility.
  • The Multimedia menu includes a Sound recorder, Audio mixer, CD Player, Volume controls, and the GTV MPEG player.
  • The Settings submenu contains Desktop options for Backgrounds and Screen savers, a Menu editor, as well as peripheral settings for the keyboard and mouse. The System submenu provides access to a System monitor, System information, Network, and Printer configuration. It also allows the user to create a boot disk and change their password.

GNOME Applets

Several useful small programs known as applets are also available. These are accessed from the Applets menu off the GNOME main menu under the following categories:

  • Amusements
  • Monitors
  • Multimedia
  • Network
  • Utility

Following are some of the more interesting ones on the Utilities submenu:

  • Gnotes, which can put sticky notes on the desktop
  • GNOME Weather, which allows the tracking of the weather in many different cities
  • ScreenShooter, which is a screen capture program

KDE Programs and Utilities

KDE also include many open source applications and utilities. Some of these are the same as those included with GNOME. The logic is that whichever desktop the user chooses, they will have similar tools available. Figure shows the KDE main menu.

 

3.4 GNOME and KDE Applications
3.4.5 UNIX graphical desktop applications comparison
The chart shown here compares some of the more useful graphical applications and Utilities that come with Solaris CDE, GNOME, and KDE. However, this is not a complete list. Use the scroll buttons to see the entire chart. The entries for GNOME and KDE are based on the Red Hat Distribution of Linux. The Sun StarOffice productivity suite is included with Solaris and Red Hat. StarOffice applications are installed under KDE with Red Hat. Although StarOffice is available, only the native GNOME and KDE applications are listed in the table. Note that some of the applications listed for GNOME are also available from the KDE menus and vice versa.

 

  Summary

CDE is a standard graphical user interface for the commercial UNIX platform. CDE comes with several built in productivity applications such as the Mail Tool and Calendar Manager. Several others also are included, such as Voice and Text Notes, Address Manager, Calculator, and Clock. The student will also have the capability of opening a Terminal window at any time to access the command line.

The Mail Tool is a graphical email application that can perform all normal e-mail functions. It allows the student to view e-mail and attachments, compose new e-mail with attachments, and delete old messages. Received messages can be saved and managed by filing them in alternate mailboxes.

The Calendar Manager manages scheduling and appointments through the use of a powerful graphical interface that supports networking. The student can view their calendar in several formats by clicking icons. The student can add new appointments and find existing ones. Many options can be set with the calendar. The calendar can be shared with other users. Also the student can make appointments on other people's calendars if they have given the user permission to do so.

Many other graphical applications are built into the CDE. The ones that this chapter focused on include Voice and Text Notes, Address Manager, Calculator, Icon editor, Image viewer, Snapshot, and Clock.

Opening a Terminal window from CDE starts a new shell. The student has a command line available in the Terminal window, which enables them to enter commands and run command line utilities. Entering the dtterm& command opens another Terminal window.

The GNOME and KDE desktops are included with most distributions of Linux. The user can install either one or both of them. Both GNOME and KDE will also run with Solaris. These open source GUI desktops include applications and utilities that perform the same functions as CDE in the commercial UNIX environment.***********************************************************************************************************************************************

 

  Overview
This chapter deals with one of the most important areas of network security and support, the backing up and restoring of data. Backups are another key component in a comprehensive security plan. This chapter covers the most common network and workstation backup strategies. This chapter introduces the built in UNIX backup utilities. To back up or easily transfer files via email, ftp, or another method, the student will need to be able to package and restore the files easily. In this chapter, the student will work with the tape archive (tar), Java archive (jar), and cpio utilities to perform backups of data as well as restore data from backups. This chapter also covers specific instructions for backing up and restoring the student's home directory. In addition, the popular compression programs such as zip and GNOME's gzip are introduced. Finally, the use of the CDE File Manager to perform basic backup tasks is covered.

 

12.1 Backup Strategies
12.1.1 The importance of backups
Good backups are critical to the health of a network. The value of a good backup system is most appreciated when it is needed in an emergency. When a system is down and data becomes unavailable, users cannot get work done and companies cannot do business.

A well managed network includes regular backups performed by a system administrator. Having a good backup system and a tested restoration process can save an organization millions of dollars and thousands of hours in lost productivity.

Causes for Lost or Corrupted Data

Data can be lost or corrupted from a number of causes, as summarized in the figure and discussed in the following sections.

Hard Disk Failure

Disk drives, such as floppies, hard disks, and CDS, are the most likely components in a computer to fail. These disk drives fail because they are electromechanical devices, containing electrical and mechanical components, with moving parts that wear. Most other components in a computer, such as the CPU and RAM, are electronic with no moving parts. When a hard drive fails, some or all of the data on the drive can be damaged or can become inaccessible. This is why fault tolerant disk systems such as Redundant Array of Independent Disks-Level 5 (RAID 5) were developed for network servers. RAID 5 combines three or more drives as a group so that if one fails, the others take over. The bad drive can be replaced with no loss of service to the users. Another fault tolerant technique, RAID 1, or mirroring, uses two drives, with the second drive storing the same data as the first. If one of the drives fails, the other takes over. A more durable version of RAID 1 that uses dual drive controllers as well as dual drives is known as duplexing. Fault tolerant disk systems are the first line of defense in a solid backup strategy.

File Corruption

File corruption can occur as the result many things. Improper system shutdown, magnetic fields from motors and other electrical devices near the data, or an area of the disk going bad can cause file corruption. The data becomes inaccessible, in any of these situations. A good backup system will allow the administrator to find and recover a specific file or group of files that might be lost because of corruption.

Malicious Destruction

Files also can be lost because of intentional destruction of data. File deletion can result from disgruntled employees, virus attacks, or hackers who can remotely access a system. Damage can vary from deletion of one or two files to the loss of all data on a hard drive.

Most virus attacks come from the Internet. Firewalls can help in some cases. Fortunately, not many viruses can infect UNIX systems. However, this is not the case with most other network operating systems and desktop operating systems. For non UNIX operating systems, virus protection software can be installed to help detect and remove viruses before the viruses can do damage. Firewalls also can help to prevent destruction of data from remote access hackers by detecting and blocking the attacks. Proper file permissions provide good protection in the case of a disgruntled employee deleting data. No amount of preventive measures can provide complete protection, and the best defense is having good backups of important data.

Disasters

Disasters such as fires and floods can destroy computers, data centers, and entire buildings. Chapter 10, "File Security", discussed the importance of a disaster recovery plan. If a fire were to destroy a place of business, how would the company recover? How much would it cost per day or per hour to not be capable of doing business?

Backups are a big part of a disaster recovery plan. To get systems back up and running quickly, it is important to have good quality, current backups of critical data. The backups also should contain copies of operating system and applications software so that they can be reinstalled. Copies of the operating system and applications software should be stored offsite at a nearby location.

Accidental Deletion/Overwrite

It is not uncommon for a user to accidentally delete a file. Files deleted from the command line cannot be recovered, except from a backup. A file that cannot be recovered from a backup may need to be recreated. Not having a backup causes a loss of productivity for the business or user. Files deleted using the CDE File Manager can be recovered from the Trash Can.

Work also can be lost because of accidental overwrites. Overwrite occurs when a user makes a copy of a file and then makes substantial changes to that file. The user then opens the original file and saves it over the one with changes. It is also possible to overwrite files when copying the files from one location to another where the file already exists. When this occurs, the only way to recover the original file is from data backups.

 

12.1 Backup Strategies
12.1.2 Backup methods
Several different backup types or methods can be compared, based on how long the backup takes and how easy it is to restore data. The three most common types of backups are full, incremental, and differential backups. All the methods discussed in this chapter assume that backups to a tape drive occur daily on critical user data. Alternatives to tape backup media are discussed later in the chapter. The operating system and applications software are not typically backed up. The operating system and application software can be reinstalled from the original media.

It is common to have a set of 5 to 7 daily backup tapes, 4 or 5 weekly backup tapes, and 12 monthly backup tapes. The daily tapes can be overwritten each week. The weekly tapes can be overwritten each month. The monthly tapes usually are kept and are not overwritten. Weekly and monthly tapes should be kept offsite.

If the volume of data to be backed up requires multiple tapes, it might be necessary to install a larger capacity tape drive or a tape changing system. If a larger capacity tape drive or a tape changing system is not used, a user or system administrator would need to manually change tapes when each tape is finished. Backup methods performed by organizations vary. However, all organizations take a number of factors into account when determining which method to utilize:

  • The criticality of the data
  • The amount of data to be backed up
  • The time window available to do backups
  • Funds available for a backup system

Loss of data can be just as damaging for a small business as for a large corporation. The backup system is not the place to cut costs. Figure compares the three different backup methods. Figure shows the relationships between quantities of data backed up each day. The assumption is that the hard disk crashed and each day's backup is on a separate tape.

Full Backup

With full backup, all critical data is backed up daily. Every night after close of business, all data is backed up, whether the data has changed or not. This method takes the longest and could require multiple tapes, depending on the amount of data. A larger capacity drive or tape changing system might be required if data volumes get too large.

If an organization has a large volume of data or a short window of time to back it up, the full backup method might not work. However, a full backup is the most effective method because all data is backed up every day to one or more tapes. A full backup also can make it easier to find and restore data. Full backup is usually all on one tape or a set of tapes for a given day. For purposes of comparison to the other methods, this chapter assumes that the user can do a full backup on one tape.

Incremental Backup

With incremental backup, data is backed up in increments. All critical data is backed up once a week on a particular day. For example, the user may backup data every Sunday evening. Only changes will be backed up each day after the weekly backup. The next backup on Monday will back up only new files or those that have changed since the Sunday night backup. Tuesday's backup will back up only the new and changed files since Monday's backup. Wednesday's backup will get only the new and changed file since Tuesday's, and so on, until the user gets back to Sunday and then does another full backup. The Sunday night full backup creates the baseline backup and might take a significant amount of time. However, the successive incremental backups on the weekdays will take much less time. The amount of data and the time that it takes to back up on each weekday varies depending on the number of new and changed files. This weekday backup time will be relatively small compared to the full backup.

With the incremental backup, each tape has a piece of the whole backup. As a result, the overall time required to back up the data is significantly less than doing a full backup each day. The disadvantage of the incremental backup is the number of tapes that it might require to rebuild the data. If a hard drive fails on Monday morning, the Sunday night backup tape will be the only tape needed to restore the data. However, if the drive fails on Friday morning, it will require Sunday's full backup tape plus Monday through Thursday's incremental backup tapes to fully restore the data. This means that user must successfully read and restore data from five tapes, any of which could have a problem. This results in a more complicated and time consuming restoration process. Incremental backups back up only a portion of the data each day to multiple tapes. A failure of any of the tapes will result in a corrupt backup. Therefore, if the user needs five tapes to do the restore, the entire backup will be bad if any one of the tapes cannot be read.

Differential Backup

With differential backup, the user still does a full backup once a week. For example, the user may backup data every Sunday evening. The user would back up anything that has changed since Sunday on Monday. On Tuesday, the user would also back up anything that has changed since Sunday. On Wednesday, again the user would back up anything that has changed since Sunday, and so on. Monday's backup might not take much time because the user is backing up only one day's worth of data same as done in the incremental backup. However, every day after Monday the backup will take longer. On Saturday night, everything that has changed since last Sunday, which is six days' worth of data, is backed up.

The differential backup is a compromise between a full backup and an incremental backup. It takes less time than a full backup because the user is not backing up all the data every night. However, differential backup takes more time than an incremental backup. If a hard drive fails and the user needs to restore all the data, it will take only two tapes. As an example, if the hard drive fails on Friday morning, the user will need only the Sunday baseline tape and the Thursday night tape. The tape from Thursday night's backup includes everything from Sunday night through Thursday night. This makes restoration a little easier than the incremental backup, but not as simple as the full backup.

 

12.1 Backup Strategies
12.1.3 Data restoration issues
The backup methods discussed allow all critical data to be restored in the event of loss. The capability to restore data quickly is the true test of a good backup system. It is not enough to do nightly backups and not actually practice the restoration process.

Users typically are not required to back up their own files. The backup of files is the job of the network administrator or network support staff. The network support staff not only must do regular backups but also must test the backups periodically. The backups are tested to verify that the backups are good and that the network support staff can restore data from them.

Backups should be checked regularly by conducting test restores. The test restores verify that the tapes are good and that the staff can perform the necessary steps to restore data under a variety of conditions. To adequately test the capability to recover from data lost, the network support staff should be able to accomplish the following restoration tasks, which are summarized in the Figure:

  • Restore a file - Thousands of files typically are backed up in any organization. If a user accidentally deletes or overwrites a file, an administrator should be able to find that file on the backup tapes and restore it to the user's home directory on a server or on the workstation.
  • Restore a directory - If a directory is damaged, an administrator should be able to restore the entire directory structure, with all subdirectories and files intact.
  • Restore a file system - If necessary, an administrator should be able to restore an entire file system.
  • Restore a hard drive - In the event of a total failure of a hard drive, an administrator should be able to recreate the contents of the original drive, including the operating system, applications software, and data, if applicable.
12.2 Backup Media
12.2.1 Magnetic tape
A number of different media options exist for backing up the data. These options range from very low capacity floppy disks to very high capacity tape drives. The figure shows the variety of backup media available.

Streaming magnetic tape is the most common media for backing up large amounts of data because it is inexpensive and can store large amounts of data. Tape drives are sequential recording devices. Sequential recording means that the data is laid down in a stream of bits from one end to the other as the tape passes the magnetic read and write heads.

To locate a specific file on a tape, the tape must be rewound or advanced to the location where the file was recorded. This can take several minutes, depending on the speed of the drive and where the file is located. However, modern tape drives will continue to be widely used because tape drives are efficient, they are cost effective, and they serve as a proven backup solution.

New technology tape drives are small and very fast, and they have very large recording capacities. The cost per megabyte for tape backup is the lowest of any recording media. A single tape about the size of a videocassette can record more than 100 GB (gigabytes, or billion bytes) of data with compression. Autoloader systems with multiple tapes can exceed that capacity significantly.

 
12.2 Backup Media
12.2.2 Magnetic and optical disks
Tape drives traditionally have been the media of choice. However, new forms of backup media are starting to become popular, including optical CD recordable (CD-R) disks and CD rewriteable (CD-RW) optical disks. Various forms of magnetic media, such as removable hard drives and Jaz and Zip disks, are also becoming more common. Most of these backup media are not intended to back up large volumes of data. However, these new forms of backup are a flexible alternative that is very fast, and they can be treated as another disk drive on the computer.

Disk drives, whether magnetic or optical, have one characteristic in common. Disk drives are random access devices. Instead of advancing or rewinding, as with tape, disk drives can seek and find the desired file in a fraction of a second. This makes disk drives flexible for backing up relatively small amounts of data, usually less than 1 or 2 GB. Writeable CD changers can handle very large amounts of data with maximum flexibility. However, writeable CD changers are relatively expensive. The figure lists backup media in order of capacity.

 

12.3 Accessing Floppy Disks and CD Devices
12.3.1 Overview
Tape drives are the most common backup device. However, floppy diskettes are used extensively on desktop systems, like UNIX and Windows, for backing up small numbers of files and to exchange files between systems when a remote connection is not available to do a direct transfer.

This section will focus on how to store and retrieve files on floppy diskettes and CD ROMs in both the Solaris and Linux environments and from the command line and graphical interfaces.

 

12.3 Accessing Floppy Disks and CD Devices
12.3.2 The Solaris Volume management feature
The Solaris Volume management feature provides users with a standard method of handling data on floppy diskettes and CD ROMs. This management feature gives users access to these types of devices automatically without having to become a superuser and mounting them.

Note: If volume management is not running on a system, the vold daemon is not running, only the superuser can have access to floppy diskettes and CD ROMs.

By default, volume management is always running on the system to automatically manage CD ROMs, floppy diskettes, and removable SCSI disks, such as Zip and Jaz disks.

When the user inserts a CD ROM into the drive it is automatically detected. However, volume manager does not automatically detect when the user inserts a floppy into the floppy drive. The user must inform volume manager by using the volcheck command.

  • Runs by default
  • Manages floppies, CD ROMs and removable hard drives
  • No need to become superuser and mount
  • Automatically detects CD ROM insertion
  • Does not automatically detect floppy insertion

 

12.3 Backing Up, Compressing, and Restoring Files
12.3.3 Working with Solaris floppy diskettes and CD ROMs
The volcheck (volume check) command or Open Floppy option on the CDE File Manger File menu, instructs Solaris to do the following: · Check the floppy drive · Determine the disk type, whether UNIX or DOS · Temporarily place or mount the floppy disk under the /floppy directory of the hard drive. If Solaris detects a floppy diskette in the drive the message "media was found" is displayed. Once the diskette is mounted, the student can access files on diskette either from the command line or from the CDE File Manager Floppy window. See Figure .

To access a formatted disk from the command line:

  1. Change directories to /floppy
  2. Type ls and press Enter. The name of the diskette is displayed as the name of a directory.
  3. Type cd diskette-name and press Enter.
  4. Type ls and press Enter. The files on the diskette are displayed. The student can copy to and from the diskette using the cp command.

To eject a floppy diskette the student must not be in the /floppy directory. The "Device busy" message will appear if the student is in the /floppy directory. Once out of the /floppy directory, the student then types eject fd or eject floppy. This will unmount the floppy from the file system on Sun Solaris systems. The student must then manually eject the floppy. To eject or unmount a floppy using the CDE File Manager select Eject from the File menu.

Floppies can also be mounted and unmounted under Solaris using the mount and umount commands described in the subsequent Linux section on floppies and CD ROMs.

Formatting a floppy diskette with Solaris

To create a floppy diskette for storing UNIX files the student must format the diskette and create a UNIX File System (ufs) on the diskette. Any user can format the UNIX diskette from the command line with the fdformat (floppy disk format) command but only the superuser can execute the newfs /vol/dev/rdiskette0/unnamed_floppy command to create a ufs on the diskette.

For this reason it is best for users to use the Format option from the CDE File Manager, Removable Media menu. Select the floppy disk and click the Selected menu and then Format. The format command allows the user to format a diskette and specify that either a UNIX or MS DOS file system be created with out having to be the superuser.

Using Diskettes with tar and cpio

Later in this chapter the student will be introduced to two popular UNIX backup commands, tar and cpio.

In order to copy files to a diskette using either tar or cpio the diskette must be formatted, using fdformat or the CDE format command. If a UNIX file system does not exist, tar and cpio will create their own unique file system when files are copied to the diskette. Access the floppy diskette using the device file name of /vol/dev/aliases/floppy0 when using either tar or cpio.

CD ROMs

The volume manager automatically detects the presence of a CD ROM, unlike floppy diskettes, and temporarily mounts it under the /cdrom directory of the hard drive. If the CDE File Manager is running, a new File Manager window displays the contents of the CD ROM. The student can access data from this window and the command line interchangeably using the pathname /cdrom/cdrom0. See Figure .

To eject the CD ROM the student must not be in the /cdrom directory. The "Device busy" message will appear if the student is in the /cdrom directory. Once out of the /cdrom directory the student then types eject cd or eject cdrom. To eject the CD ROM using the CDE File Manager select Eject from the File menu.

 

12.3 Backing Up, Compressing, and Restoring Files
12.3.4 Linux floppy and CD ROM access
The principles of working with removable media are the same in Linux as for other versions of UNIX. Before using a new floppy disk, the disk must first be formatted. Then either a UNIX or DOS file system must be put on the floppy disk. A floppy with a UNIX file system can be mounted and copied to the same as a hard disk partition. With a DOS file system, the device acts like the floppy disk in a PC. Files can be copied, listed, and deleted using the mtools utilities. Mtools is a collection of utilities to access MS DOS disks from UNIX without mounting the disks. The mtools come with many distributions of Linux including Red Hat. However, the mtools may need to be installed in order to make them available. Mtools can also be downloaded, along with instructions for their use, from http://mtools.linux.lu

Low Level Formatting 

Most floppy disks are sold with the low level format already done. The student will need to do it only in exceptional cases. Such cases would be when the user thinks a disk has corruption or one or more bad blocks. The fdformat command is used to do a low level format on a new floppy disk, the same as in Solaris. The student does not have to be root to do this. 

Device names tend to vary between versions of UNIX. The standard floppy disk drive in a Linux system is accessed using the device path /dev/fd0. To perform a low level format of a floppy disk, use the command: 

fdformat /dev/fd0 

Figure shows the output normally seen on a terminal screen. After formatting the 80 tracks of the disk, fdformat proceeds to verify the format track by track. To skip the verification, the user inserts the -n option to fdformat before the device name. 

Putting a File System on the Floppy

To create a UNIX file system on a floppy disk, the student uses the mkfs command. Only root may make file systems on a hard disk, but non-root users may use mkfs to do so on a floppy disk. The command to create a file system on a standard floppy is

mkfs -t ext2 /dev/fd0 1440 

The -t ext2 tells mkfs what file system type to make, /dev/fd0 is the device path, and 1440 is the number of blocks to create. A standard 1.44MB floppy has 80 tracks with 18 sectors each, or 1440 blocks. The ext2 file system is the most common with Linux systems. 

Putting a DOS File System on the Floppy 

Even if a floppy disk already has a UNIX file system and files on it, it may be reformatted as a DOS disk quickly with the mformat command from the mtools utilities. However, a UNIX-formatted disk must be unmounted first. (See Mounting a Floppy.) 

mformat takes an argument that corresponds to its device identifier in a DOS system, normally A:. The command used to make a DOS floppy is:

mformat a: 

This format should take only a couple of seconds to run. The student may then use mtools commands on the floppy in the drive. 

Using gfloppy to Format and Put File Systems on a Floppy 

If a student is using a graphical display such as GNOME, a gfloppy may be used to accomplish floppy formatting of either type, including putting a file system on it. In GNOME, gfloppy may be found on the Utilities menu. It may also be run as a shell command. 

Note: It is necessary to have the mtools utilities installed in order to have the option to format DOS floppies with gfloppy.  

Figure shows a gfloppy window open. DOS (FAT) is selected as the File system type, the usual High Density 3.5" (1.44 MB) type selected as Floppy Density, and the Quick format checkbox selected. The command runs quicker with Quick format selected. 

Mounting a UNIX Floppy Disk

Use the mount command to mount a floppy disk with a UNIX file system on it. It is not necessary to mount a DOS floppy disk. Linux does not run a volume manager or support the volcheck command for mounting floppies as with Solaris. Most Linux distributions configure systems so that nonroot users may mount and unmount floppy disks. If a correct set of options has been defined in the file /etc/fstab to allow this operation, the command to mount a floppy disk is:

mount /mnt/floppy

Thereafter the directory /mnt/floppy may be accessed as any other directory on the system, as the location to put and read files on the floppy disk.

When the student is finished with a UNIX mounted floppy, it must be unmounted. To do this, the student uses the umount command. Notice that there is no 'n' in the spelling of umount.

umount /mnt/floppy

On Intel based Linux systems the eject command does not unmount a floppy as it does with Solaris. Instead on Intel based Linux systems the eject command defaults to ejecting the CD ROM.

Note: Never simply remove a UNIX-mounted floppy disk from the drive. Floppy drives do not have a locking mechanism that prevents the user from popping a disk out while mounted, as other devices do. To remove the floppy disk without unmounting it will confuse the operating system and could also damage files on the floppy.

Mounting and Unmounting in GNOME

In GNOME, user mountable drives may be mounted and unmounted using the Drive Mount applet. The student may add as many copies of this applet in a panel as there are removable devices in the system. The default configuration is for floppy drives, but it may also be set for CD ROM, Zip, Jaz, and even hard drives.

To use the Drive Mount applet to mount and unmount floppies, drop the applet's icon from a menu into a panel. Right click on the icon to bring up the Drive Mount Applet Properties window, as shown in Figure . From the Drive Mount Applet Properties window any options the student would like can be customized.

Note: The mount point must be an existing empty directory. Unless another mount point has been defined in the file /etc/fstab by a system administrator, the student should not change this option. Changing this option will cause mounts to fail, and the applet to crash.

 After the Drive Mount applet has been installed in a panel, click on the icon after inserting a floppy disk or CD-ROM. The media will mount, the icon's appearance will change, and an icon will also appear on the desktop. Click the applet's icon again to unmount the drive.

 

12.3 Backing Up, Compressing, and Restoring Files
12.3.5 Working with CD ROMs in Linux
The manner of working with CD ROM disks in Linux is similar to working with floppy drives, except that CD ROM disks do not need to be formatted. However, data CDs must be mounted and unmounted like a floppy disk or hard disk partition. GNOME enables users to mount data CDs automatically upon inserting the CDs in the drive. To do this, follow these steps:
  1. Open a Nautilus window by clicking on the Start Here icon.
  2. Click on Preferences, Peripherals, and finally CD Properties.
  3. Data CDs will mount in the path /mnt/cdrom when the student inserts the CDs in the drive.
  4. If there is an auto run program on the CD, it will begin to execute.
  5. The Nautilus file manager will open a window on the CD.

The figure shows the CD Properties window with the appropriate checkboxes selected.

As previously discussed the student may also install a Drive Mount applet in a panel and configure its properties to work with the CD ROM drive.

The student may mount and unmount CDs as nonroot from a terminal window using these commands:

mount /mnt/cdrom

umount /mnt/cdrom

A Note on Audio Disks

CD ROMs that contain recorded music and sound are quite different from data disks. CD ROMS that contain recorded music and sound are not mounted. In the figure, the option to run a command has been selected when the system recognizes the media inserted as an audio disk. The command entered in the example, the default, will run the GNOME audio CD player, and will start playing the CD.

 

12.4 Backing up, Compressing and Restoring Files
12.4.1 Backing up files with tar
The UNIX operating system has several integrated utilities that allow multiple files to be backed up and compressed. The tar (tape archive) command enables the student to back up single or multiple files in a directory hierarchy. The tar command is standard with all versions of the UNIX operating system. tar originally was developed for use with tape drives. However, tar can copy files to other locations on the hard disk or to a floppy disk and other removable media. The tar command can create an archive from a single file. However, tar is primarily used to combine multiple files, such as the contents of a directory, into a single file and then extract contents later, if they are needed. By itself, tar does not compress the files as it bundles them, like the PKZIP and WinZip programs for PCs. Many types of applications and upgrade packages for Linux are distributed in the form of Tarballs, which are groups of files combined into one.

The most frequently used options available with the tar command are c, t, and x. It is not necessary, but acceptable, to precede these with a dash (-), as with other UNIX command options. The command syntax is shown here. Refer to Figure for an example with an explanation of the syntax. Figure shows the functions, letters and modifiers that are used with the tar command. 

tar function [modifier ] [output file ]filename(s)/directory(s) 

Note: When specifying the name of the output file to be created, be sure to specify a .tar extension so that tar files can easily be distinguished from others.

tar Functions 

tar functions are one letter characters used to create a tar file, view the contents of a tar file, or extract files from a tar file. These functions are summarized here: 

  • c (create) is used to archive one or more files or directories to create an archive file. 
  • t (table of contents) is used to see a table of contents of the tar file. This is a listing of the files that were combined to make the one tar file. 
  • x (extract) is used to extract the file or files from the archive and separate them into multiple files again. The tar file still exists after this is done. 

Function Modifiers 

tar function modifiers are one letter characters used in conjunction with a function character when creating, viewing, or extracting from a tar file. The two most common function modifiers are summarized here: 

  • f (file) allows the student to specify a tar file to create (c), extract from (x), or see the table of contents of (t). 
  • v (verbose) executes the command in verbose mode, which enables the student to see the detailed results of the tar command as they occur. 

Figure illustrates some examples using the tar command. These examples are explained in greater detail below. 

  • The first example archives all files in the user2 directory to tape. If no filename (f) option is specified, the default output device is tape /dev/rmt/0. Raw magnetic tape 0 is the first tape drive on a Solaris system. Device filenames vary between UNIX flavors. A tape drive used with Linux may be called /dev/st0 (SCSI tape 0) or something similar. 
  • The second example archives all files and subdirectories in the dir2 to a tar file called dir2.tar, and places it in the /home/user2/backup directory. Refer to the class file tree and the student will see that beans and recipes are subdirectories, whereas notes is a file. Any files in subdirectories also will be included in the resulting tar file. 
  • The third example combines several files to create an archive file called files.tar in the default directory of the hard drive. This default directory is usually the student's home directory. 
  • The fourth example views the table of contents of the tar file in verbose mode, which displays the detail of the files including permission and size. 
  • The fifth example archives three files to the Solaris floppy disk for backup. 

Tip: To append another file or files to an existing archive, use the -r option. For example, $tar rvf files.tar newfile adds or appends the newfile to the existing files.tar archive file.

Interactive Media Activity (Flash, 95 kB)
  Archiving Files with tar

In this media activity, the student is logged in as user2 and the current working directory is: /home/user2. Refer to the Class File Tree Structure by clicking the 'tree' button located on the Menu Bar. Type the commands that would accomplish the requested objectives. Note: Be sure to press enter after each one. Click on step 1 to begin.

 

12.4 Backing up, Compressing and Restoring Files
12.4.2 Compressing files
The student should archive files that have not been used for a while and then compress the files so they take up less disk space. It is also a good idea to compress files before transferring them to another UNIX user, that has the uncompress command. Compressing the files will save time. Any file, including those archives created with tar , can be compressed. Compression is a valuable tool because it reduces the amount of disk space that files occupy, while still keeping the files readily available. 

The compress command is used to compress files and is included with all versions of the UNIX operating system. The compress utility uses a special format to reduce the size of the file anywhere from 20 percent to 80 percent, depending on the type of file. If the compress utility determines that the file cannot be compressed or that there will be no reduction in file size, the file will remain unchanged. See Figure

When files are compressed with the compress command, the existing file is replaced using the same name but with a .Z suffix appended. Note that this is an uppercase letter Z. Figure shows an example of the compress command with the verbose (-v) option. Figure shows the name of the input (bin.file) and output files (bin.file.Z) and the amount of compression achieved. Use the ls -l (list long) command before compressing a file to see its original size in bytes. Use the ls -l command again after the file has been compressed to see the compressed size. Multiple files can be compressed simultaneously, and wildcard metacharacters are supported. Compressed files are considered binary and cannot be viewed with the cat or more commands. 

compress option file1 file2 

 

12.4 Backing up, Compressing and Restoring Files
12.4.3 Compressing and uncompressing files

Uncompressing Files 

The corresponding command used to reverse the effects of the compress command is uncompress. Files cannot be used in their compressed form. It is necessary to use the uncompress command to restore the files to their original size. The uncompress command is a UNIX utility and can be used only to uncompress files compressed with the UNIX compress command. Figure shows an example of the uncompress command with the v (verbose) option. This allows the student to see the results of uncompressed process. 

Note: It is not necessary to specify the .Z extension with the uncompress command. This command can uncompress multiple files and support the use of wildcard metacharacters such as ? and *. 

Tip: To view the contents of a compressed file without actually uncompressing it, use the -c option. For example, to view the contents of the june02bkup.tar.Z compressed file, use the following command:

uncompress -c june02bkup.tar.Z | more. 

Interactive Media Activity (Flash, 95 kB)
  Compressing and Uncompressing Files

In this media activity, the student is logged in as user2 and the current working directory is: /home/user2. Refer to the Class File Tree Structure by clicking the 'tree' button located on the Menu Bar. Type the commands that would accomplish the requested objectives. Note: Be sure to press enter after each one. Click on step 1 to begin.

 

 

12.4 Backing up, Compressing and Restoring Files
12.4.4 Backing up and compressing the home directory
Because most work is done in a user's home directory, system administrators often schedule these directories for backup on a nightly basis. If the system administrator is not backing up the user's home directory, it is good practice to perform a regular nightly backup of changing data. This section describes the process used to archive the student's home directory files to a tar file and then compress it. Figures through summarizes the steps necessary to accomplish this. The section following this one describes how to restore the files that were backed up and compressed.

 

12.4 Backing up, Compressing and Restoring Files
12.4.5 Restoring files
This section describes the process of restoring the compressed tar file of the student's home directory that previously was created. Just as tar can combine files to a single archive file, it can be used to restore them. To restore files in the student's home directory, perform the following steps that are summarized in Figure

Step 1. Make a new directory and change to it. In the home directory, make a new directory and change to it to prevent overwriting files. This will create a separate directory to temporarily hold the restored archived file.  

$cd 

$mkdir newhome 

$cd newhome 

Step 2. Extract the home directory from tape. The x option extracts the previously tarred file from tape, using the default tape device, to the student's current directory (/home/newhome). The v (verbose) option lets the student see the activity as the file is copied. Because no file is specified, home.tar.Z, which is the only file on the tape, will be copied to the current directory.  

$tar xv 

Step 3. Uncompress the compressed tar file. After the file has been copied from tape to the newhome directory, the student can uncompress the home.tar file.  

$uncompress home.tar.Z 

Step 4. Extract the tar file. After the file is copied from tape to the newhome directory, the student can extract all files or individual files from the home.tar file.  

$tar xvf home.tar (extracts all files from home.tar) 

$tar xvf home.tar filename1 filename2 (extracts individual files from home.tar) 

Step 5. Move files as needed. The files in the student's newhome directory now can be moved to replace those in the student's real home directory. 

Interactive Media Activity (Flash, 95 kB)
  Extracting files with the tar command

In this media activity, the student is logged in as user2 and the current working directory is: /home/user2. Refer to the Class File Tree Structure by clicking the 'tree' button located on the Menu Bar. Type the commands that would accomplish the requested objectives. 
Note: Be sure to press enter after each one. Click on step 1 to begin.

 

 

12.5 Combining Backup and Compression
12.5.1 The jar command
The jar (Java archive) command is similar to the tar command, but it compresses the resulting file in the same step. It is a Java application that combines multiple files into a single jar (Java archive) file. It is also a general purpose archiving and compression tool, based on ZIP and the ZLIB compression format. The jar command originally was created for Java programmers to download multiple files with one request, rather than having to issue a download request for each separate file. The jar command is standard with the Solaris operating system. However, the jar command is available on any system that has Java virtual machine (JVM) installed. The syntax for the jar command is almost identical to the syntax for the tar command. Figure shows the options available with the jar command.

It is not necessary to use a hyphen (-) before options when issuing the jar command. Figure provides an example of the use of the jar command to archive and compress all directories and files in the /home/user2 directory.

Interactive Media Activity (Flash, 101 kB)
  Archiving and Compressing Files with jar

In this media activity, the student is logged in as user2 and the current working directory is: /home/user2. Refer to the Class File Tree Structure by clicking the 'tree' button located on the Menu Bar. Type the commands that would accomplish the requested objectives.
Note: Be sure to press enter after each one. Click on step 1 to begin.

Lab Activity
  Command Line Archive Tools

In this lab, the student will work with the tape archive (tar) and Java archive (jar) utilities to perform backups of data, as well as restore data from backups. We will cover the UNIX file compression utility, and the student will use the tar and compress commands to back up and restore the student's home directory.

 

 

 

 

12.6 Alternate Backup and Compression Programs
12.6.1 Open source command line programs
Many third party compression programs are available for UNIX. This section covers the most popular ones that can be downloaded and used as an alternative to those that come with a particular version of UNIX.

The GNU Compression Commands

GNU provides several commands that can supplement the tar and jar commands. Gzip, gunzip, and gzcat are available in most types of UNIX. If not, these commands can be downloaded from www.gzip.org. The gzip utility is similar to jar. The gzip utility is a popular open source tool for combining and compressing files. Gzip is bundled with most Linux distributions.

Gzip and gunzip work the same way as compress and uncompress. Gzip typically produces a smaller file than compress and adds a .gz extension instead of .Z. An advantage of gunzip is that it can uncompress files created with compress and several other compression programs.

Figure shows an example of using the gzip commands.

The GNU tar command supports compression. The -z option compresses with gzip and -Z compresses using the compress command. For example tar -cvzf /temp/bkup.tar /home/user2 will use the gzip command to create a compressed bkup.tar file of the user2 directory tree.

Another feature GNU tar supports is the ability to span a backup across multiple (-M) volumes, whether disks or tapes. For example the command below would backup all files in the current directory to the Solaris floppy disk and prompt the user to insert a second disk if required. This is similar to the -k option with the Solaris tar command.

tar -cvf /vol/dev/aliases/floppy0 -M *

zip and unzip Commands

Due to the popularity of the PKZIP and WinZip programs used in the DOS and Windows worlds, there are now UNIX versions that work in the same way and can read files zipped on a PC.

The zip command is similar to the jar command and is capable of compressing multiple files into a single zip file. The unzip command is used to uncompress a file created with zip. Figure shows an example of using the zip and unzip commands.

Note: If the version of UNIX that the student is using does not have the zip command, the student should do an Internet search to locate a download site. Use the UNIX zip command if the student will be exchanging files with a PC user.

 

12.6 Alternate Backup and Compression Programs
12.6.2 Backing up files with cpio
The cpio (copy in-out) is another popular UNIX backup command and is used to copy files to and from a backup device. Like the tar command cpio creates a single archive containing multiple files. A big difference is that cpio uses a generated list of files or pathnames from the output of another command, like Is or find, instead of specifying file and directory names. cpio then writes the selected files to standard output, which is usually redirected to a file or device. cpio options filename(s) Figure shows the options available with the cpio command.

Note: the student must specify one of the following options: o, i, or p on the cpio command line.

Creating and viewing the archive

Since the cpio command only uses standard input, the student can use ls or find to generate a list of filenames to serve as input to cpio. Figure illustrates some examples using the cpio command to backup files and view the archive. Note: backing up using absolute path names can be risky because the user can overwrite the original files when restoring.

Examples 1 and 2 copy the files in the current directory to the Solaris floppy disk. Example 1 uses redirection. Example 2 uses -O option and specifies the device file name as the output file.

Example 3 finds all files in the current directory and copies them to a file named mydir.cpio. Examples 4 and 5 list the file names in the mydir.cpio archive file.

Example 4 uses input redirection.

Example 5 uses the -I option and specifies mydir.cpio as the input file.

Example 6 finds all files in the home directory that have been modified within the last seven days and copies the files to a file named modified.cpio.

Restoring files

A complete archive or selected files can be restored with the -i option using either input redirection or the -I option. Figure illustrates some examples using the cpio command to restore files from the archive.

Note: cpio always restores files to the current directory unless the files were backed up using a full pathname.

Example 1 retrieves all files from the mydir.cpio archive to the current directory, assuming the archive was created using relative path names.

Example 2 retrieves all files beginning with "chap" from the mydir.cpio archive to the current directory, assuming the archive was created using relative path names.

Example 3 retrieves all files from the floppy diskette. Input redirection could have been used instead of the -I option.

 

 

12.6 Alternate Backup and Compression Programs
12.6.3 GUI backup tools
Third Party Dedicated Tools

Third party vendors have created dedicated backup application packages for use with the UNIX file system that utilize a graphical interface. Most mission critical servers utilize one of these packages for regular backups. These application packages typically provide more advanced features with greater flexibility in scheduling and managing backups and restores. These packages also have sophisticated logging and error reporting capabilities for monitoring backup results to help ensure successful backups. See Figure .

Using CDE to Archive, Compress, and Restore

The Files subpanel on the Front Panel in conjunction with File Manager can be used to archive and compress files. This creates the same results as using the tar, compress, and uncompress commands.

Archiving a File

The student clicks the File subpanel from the CDE Front Panel. The student then selects the Archive menu option, as shown in Figure . The Archive window, shown in Figure , will open to allow the student to enter the following information:

  • Folder for archive is the folder where the archive or tar file will be placed. The default is the student's home folder. For example, /home/user2.
  • Name for archive is the name that the student wants to give the archive file.
  • File or folder to archive is the name of a folder, file, or group of files to be combined into an archive.

The student can use wildcard metacharacters such as ? and *.

Restoring an Archive

The student opens File Manager and navigates to the folder where the archive file was placed, the default is the student's home directory. The student selects the archive, which should have a .tar extension. The student then uses either the Selected menu or right clicks the mouse to get to the Archive Unpack option. See Figure . If the original file exists in the directory where the archive is unpacked, it will be overwritten by the unpacked version.

Compressing a File

The student clicks the File subpanel from the CDE Front Panel, and then selects the Compress File menu option, as shown in Figure . The Compress window, shown in Figure , will open to allow the student to enter the name of the file to compress. The compressed file will be renamed with a .Z extension, and it will reside in whatever directory it was in before the compress. The default is the home directory. Uncompressing a File The student opens File Manager and navigates to the folder where the compressed file was placed. The default is the student's home directory. The student selects the compressed file, it should have a .Z extension. The student then either uses the Selected menu or right clicks the mouse to get to the Uncompress File option, as shown in Figure . The file will be uncompressed and renamed back to its original name, with the .Z extension removed

Lab Activity
  CDE Archive Tools

In this lab, the student will work with the Common Desktop Environment (CDE) utilities to back up, compress, and restore files and folders. The Files subpanel on the Front Panel, in conjunction with File Manager, can be used to archive, compress, and restore files creating the same results as using the tar, compress, and uncompress commands.

 

  Summary
Backing up data is one of the most important functions that a network administrator can perform. Data can become lost or corrupted for a variety of reasons. The most important thing is to have good backups available to restore the lost data quickly and accurately.

Three basic backup strategies exist: full, incremental, and differential backups. Full backups take the longest but are the easiest to restore. Incremental backups take less time but are harder to restore because more tapes are involved. Differential backups are a compromise, taking less time than a full backup and being easier to restore than an incremental backup. Magnetic tape traditionally has been the primary backup media because of it's the tape's high capacity and relatively low cost. Recently, some newer technologies such as removable drives, Jaz disks, and writeable CDs have begun to replace tape drives for backing up quantities of data of less than 1 GB.

Solaris and Linux have different ways of working with removable media devices. The Solaris volume manager automatically mounts CD ROMs and diskettes when the volcheck command is used. This is similar to the Linux Drive Mount applet. Both Solaris and Linux use the fdformat command to format a floppy diskette.

The UNIX operating system has several command line backup utilities available, including tar (tape archive), jar (Java archive), compress/uncompress commands, and cpio. The tar command combines multiple files into an archive file but does not compress them. The tar command can be used to archive and extract files. The compress command is used to reduce the disk space taken up by a file. The uncompress command expands files back to their original size so that user can work with the file. The jar command combines the capabilities of the tar and compress commands, and simultaneously can archive and compress files. When files are extracted, they are automatically uncompressed. Cpio is a flexible backup command allowing the user to copy files in to a cpio archive by reading a list of files generated by the Is or find commands.

Several other open source UNIX compression programs are available for free. The gzip and gunzip commands are used to compress and uncompress files. gzip creates a smaller file than compress.

The zip and unzip commands work the same way as the PKZIP commands on a PC. The zip and unzip commands should be used if exchanging files with a PC user.

CDE has some graphical tools to archive and compress files, which are available from the Files subpanel on the Front Panel. The CDE File Manager can be used to extract and uncompress files.

 ***************************************************************************************************

  Overview
The shell is the primary user interface to a UNIX system. The concept of the shell was introduced in Chapter 1, "The UNIX Computing Environment". Also introduced in Chapter 1 were other key UNIX operating system components such as the kernel and the file system. UNIX provides support for many built in shells, such as Bourne, C, Korn, and Bash. Unix also provides support for third party shells. This chapter provides a brief review of the function of the shell and focuses on two of the most widely used shells today: the Korn and Bash shells. The Korn shell is the default shell for Solaris users and the Bash shell is the default for Linux users. This chapter goes into greater detail about the unique features of each shell including custom prompts, aliases, history, and re-execution of commands. Finally, the chapter discusses variables and initialization files used to customize the work environment.

 

14.1 Review of the Shell 
14.1.1 Shell overview
A shell is an interface between the user and the kernel. The shell acts as an interpreter or translator. In other words, the shell accepts commands issued by the user, interprets these commands, and executes the appropriate programs.

Shells can be command line or graphical. Shells are also interchangeable, making it possible to initiate or switch between the shells at any time to use certain features not available in other shells.

The shell is the first program to run when the user logs onto the system. In addition to the shell's primary role as a command interpreter, the shell program has numerous features and built in commands that make interacting with the system and completing tasks easy. Several of the shell features have already been addressed in this course including:

  • Wildcard matching uses special characters to select one or more files as a group for processing. For example, $lp chap*. See Chapter 5, "Accessing Files and Directories" for more information.
  • Input/output redirection uses special characters for redirecting input (> or >>) and output (<). For example, $who > userlog. See Chapter 7, "Advanced Directory and File Management" for more information.
  • Pipes are used to connect one or more simple commands to perform more complex operations. For example, $who | sort | lp. See Chapter 7, "Advanced Directory and File Management" for more information.
  • Background processing enables programs and commands to run in the background while the user continues to interact with the shell to complete other tasks. For example, $sort largefile &. See Chapter 13, "System Processes" for more information.
  • Programming language features are used to create shell scripts that perform complex operations. For example, a shell script was written to set up all the user accounts, create home directories, and copy lab files into each user's home directory for the Fundamentals of UNIX class. See Chapter 15, "Introduction to Shell Scripts" for more information.

This chapter focuses on additional features of the Korn (ksh) and Bash (bash) shells that make working with the shell easier and more productive.

 

14.2 Additional Shell Features
14.2.1 Aliases