System Concepts
Terms you'll need to understand:
Techniques You'll Need To Master:
This chapter covers some basic concepts of the Solaris 8 Operating System. The first section briefly summarizes the new features of Solaris 8. The second section addresses the structure and components of the operating system. The next section summarizes the three shells and the last section provides an overview of the on-line reference manual. This chapter covers the System Concepts test objectives.
New Features of Solaris 8
The following enhancements have been added to the latest release of Solaris:
The Three Parts Of The Operating System
Solaris 8, like all variations of the Unix operating system, consists of three parts: the kernel, the shell, and the file system. Each of these will be discussed in the next few sections.
The Kernel
The kernel is a collection of software that manages the physical and logical resources of the computer. These management services include controlling the allocation of memory and other storage devices, controlling the access to peripheral devices (input/output), and controlling the scheduling and execution of processes or tasks. For the most part, these services are transparent to the user. The user issues a fairly simple request to perform a task, and the operating system deals with the complexity of manipulating the underlying hardware and allocating logical resources to accomplish the task.
The physical resources are controlled by means of software modules, referred to as device drivers, that understand how to communicate with hardware devices and control their operation. Typically, each device has a unique driver that is provided with the hardware and identified by hardware manufacturer, model, and sometimes hardware version.
The logical resources include processes and memory. A process is a task or program. The kernel maintains internal data structures that are used to define and control the processes, and also controls the scheduling, execution, and termination of processes. Other important kernel services are memory management and interprocess communication. Memory management involves keeping track of available memory, allocating it to processes as needed, and reclaiming it as processes release it or terminate. Interprocess communication involves handling the cooperative communication between processes.
The Solaris 8 kernel supports multiple users, each of which can be executing one or more processes or tasks. Thus, Solaris 8 is both a multiuser and a multitasking system. The Solaris 8 kernel accomplishes this by allowing a task to have access to system resources for a small slice of time. A task is allowed to execute for one or more time slices and then is suspended to allow another task to execute. This provides time-sharing among all active tasks and gives the appearance that all tasks are running simultaneously. A task that appears to be executing all time (and typically provides a service on-demand) is referred to as a daemon.
The Shell
The shell is a software module that provides the interface between users and the kernel. It accepts user requests and submits them to the kernel. It also accepts status and data from the kernel and presents them to the user. Typically, the shell accepts user input from a terminal or network connection; however, the input can be taken from a file, a device, or even another process. In addition, output from the kernel is typically sent to the user's terminal or network connection. Likewise, this output can be redirected to a file, a device, or another process.
The shell also provides a built-in programming language that can be used to automate repetitive tasks. This includes flow control along with the ability to manipulate numeric and string data.
Solaris 8 provides several different shells, each with unique strengths. Some shells provide a history/recall mechanism that allows the user to reexecute a previous command by entering a few control sequences instead of reentering the command. Other shells provide built-in math manipulation.
The File System
A file is a group of bytes treated as a unit for storage, retrieval, and manipulation. The file system is a collection of files stored on a disk drive in a hierarchical structure. A special type of file, called a directory, serves as a folder and is used to organize files. A file system can be thought of as an inverted tree, with the directories being the branches and the files being the leaves. The name for the top-level directory of a Unix system, "root," comes from this analogy.
The Unix operating system supports the file system concept by providing utilities to create, mount (make accessible), check, repair, duplicate, and back up file systems. The storage space that is accessible on a Unix system usually is divided into multiple file systems. This allows easier maintenance and improves performance.
The Three Most Common Shells
The Solaris 8 environment provides several shells. The three most common shells are the Bourne shell (sh), the C shell (csh), and the Korn shell (ksh).
The Bourne shell was developed by Steven Bourne at AT&T Bell Laboratories and was the shell provided with the original Unix operating system. The Unix operating system was designed and developed by Ken Thompson and Dennis Ritchie at Bell Labs during the 1970s. The most popular version was Unix System V.
![]() |
The Bourne shell is the default shell for the Solaris 8 Operating System. |
The C shell was developed by Bill Joy of the University of California, Berkeley and was provided with a version of the Unix operating system that was developed at the university and referred to as Berkeley Software Distribution (BSD) Unix.
The Korn shell was designed and developed by David G. Korn at AT&T Bell Laboratories. The Korn shell was derived from the Bourne shell by adding many features from the C shell along with new features of its own. Table 2.1 compares the features of the three shells.
Table 2.1 Features of Solaris 8 shells
|
Feature |
sh |
csh |
ksh |
Function |
|
Aliasing |
No |
Yes |
Yes |
The ability to assign a short, simple name to a complex string and then to use the name in place of the string in commands. This gives the appearance of being able to add custom commands to the shell. |
|
Bourne shell-compatible syntax |
Yes |
No |
Yes |
Because the Korn shell is an enhanced version of the Bourne shell, they use the same syntax. The C shell was developed separately, and its syntax is based on the C programming language. |
|
Default prompt |
$ |
% |
$ |
The default prompt for both the Bourne and the Korn shells is the "$" character, whereas the default prompt for the C shell is the system hostname followed by the "%" character. |
|
History capability |
No |
Yes |
Yes |
The history capability of the C and the Korn shells keeps track of a user-defined number of previous commands. Instead of reentering a command, it can be copied from the history and then executed. |
|
History editing |
No |
Yes |
No |
Modify then reuse previous commands. |
|
History execution |
No |
!n |
fc |
Repeat previous command with few keystrokes. For csh, "n" is the number of the command in the history list. |
|
Initialization file: login |
.profile |
.login |
.profile |
Stores commands that should be executed once, when a user logs into the system. |
|
Initialization file: shell startup |
No |
.cshrc |
User defined |
Stores commands that are executed every time the user starts a shell to execute a command. With the Korn shell, the user can specify the name of the shell startup initialization file using the ENV parameter. |
|
Inline editing |
No |
No |
Yes |
Allows you to edit a command that has been entered but not yet executed. This allows you to correct typographical errors instead of being forced to retype the entire command. Either emacs or vi editing commands can be used.correcting errors. |
|
Logout file |
No |
.logout |
No |
Stores commands that should be executed when a user logs out. |
|
Overwrite protect |
No |
Yes |
Yes |
Prevents files from being accidentally overwritten; can be set by using the noclobber parameter. |
|
Repeat last command |
No |
!! |
No |
Handy shortcut for reexecuting the last command with only a few keystrokes. |
|
Restricted version |
rsh |
No |
rksh |
Intended for users who need only limited access to the Unix system. Provides enhanced security by confining the user to a single directory and preventing the redirection of shell output. Be sure not to confuse the restricted Bourne shell (/usr/lib/rsh) with the remote shell (/usr/bin/rsh), which is used to execute commands on a remote system. The restricted version of the Korn shell is /usr/bin/rksh. |
|
Source |
AT&T |
Berkeley |
AT&T |
Both the Bourne and Korn shells originated at AT&T Bell Labs, while the C shell came from the University of California at Berkeley. |
![]() |
Use of the initialization files for each shell is an important concept that is useful when setting up user accounts on a Solaris 8 system. Be sure that you understand their usage and associate the file names correctly with the appropriate shells. |
The Online Reference Manual
The Solaris 8 Reference Manual (in printed form) is a multi-volume set of manuals that document the commands, system calls, library functions, special files, etc. that are available with the Solaris 8 operating system. This format originated with the initial version of the Unix operating system developed by AT&T Bell Labs and has been adopted has the definitive documentation for almost every version of the Unix operating system available.
For convenience, an online version of the Reference Manual is provided with the Solaris 8 system and most other versions of the Unix operating system. The pages or topics of the online Reference Manual can be viewed on the terminal/monitor screen using the man(1) command. The Reference Manual is also included in the Solaris 8 AnswerBook2, which allows searching, displaying and printing of the Reference Manual pages using a HTML web browser such as Netscape Navigator. The pages or topics of the Reference Manual are referred to as man pages.
The Reference Manual is divided into sections. Each section addresses a related set of commands or different aspects of the operating system. Table 2.2 describes the Reference Manual Sections.
Table 2.2 Sections of the Solaris 8 Reference Manual
|
Section |
Description |
|
1 |
Describes commands available to all users. Included in this section are commands that are part of the BSD Compatibility Package (1B), commands used to communicate between systems (1C), commands associated with the Form and Menu Language Interpreter (1F) and commands specific the SunOS system (1S). |
|
1M |
Describes commands used for system maintenance and administration. Some are restricted to system administration login accounts (such as root). |
|
2 |
Describes low-level operating system calls that can be used by C language programs to access and control system resources. |
|
3 |
Describes functions available in system libraries that can be used by C language programs to access and control system resources. This section is subdivided based on library function (basic, networking, threads, curses, etc.) |
|
4 |
Describes the format of various system configuration files. Also included are descriptions of the C language data structure declarations that can be used to access some system files via a C language program. |
|
5 |
Contains miscellaneous topics such as standards, environments and macros |
|
6 |
Describes any available games or demos. |
|
7 |
Describes special files associated with specific hardware, device drivers and components of the STREAMS I/O subsystem |
|
9 |
Describes two kernel-level device drive specifications: the Device Driver Interface (DDI) and the Driver/Kernel Interface (DKI). It is subdivided based on topic (entry points, functions, data structures., etc.) |
Note that Section 8 is not used. In the original AT&T Unix System V operating system, Section 8 was used to describe special system maintenance procedures. For Solaris, these procedures are described by the System Administration Guide and other guides and manuals.
Typically each Section of the Reference Manual is printed as a separate volume. When a man page is referenced in text, the section number may be specified in parenthesis after the name of the command. For the online manuals this is may not be important, but if you are trying to locate a manual page within a stack of printed manuals that's more than a foot high, knowing the section number (i.e., which volume) saves a lot of time and effort. Thus, man(1) indicates that the man command is located in Section 1 - User Commands.
Using the man Command
Even though both the printed Reference Manual and AnswerBook2 are available, the test objectives for Part I include using the online man pages as a requirement. The man(1) command is used to display one or more man pages specified as command line arguments. Table 2.3 lists the command line arguments available with the man command.
Table 2.3 Command Line Arguments for the man command
|
Argument |
Description |
|
name |
The name of a Solaris command, file, etc. that is describe by a man page of the same name. At least one name is required by all arguments except the -f, -k and -M arguments. More than one name (separated by spaces) can be specified. |
|
- |
Don't automatically send output through the more(1) command (which provides pagination, underlining, etc.) |
|
-a |
Display all man pages that match the specified name (regardless of section) |
|
-d |
Display debug information (search methods used, sections searched, etc.) used to locate the name man page. |
|
-f file ... |
List man pages that reference the specified file (requires pre-formatted man pages). More than one keyword can be specified (separated by spaces). Note that this argument is used to locate a file referenced in the man page, not a man page (therefore it does not require a man page name argument). |
|
-F |
Force a search of all man sections for name instead of using the windex database to locate man pages (windex is associated with pre-formatted man pages). |
|
-k keyword ... |
Print a summary of all windex database entries that contain the specified keyword (pre-formatted man pages only). More than one keyword can be specified (separated by spaces). Note that this argument is used to locate keywords in a database, not a man page (therefore it does not require a man page name argument). |
|
-l |
List all man pages that match the specified name (regardless of section). |
|
-M path |
Specify an alternate directory path for man page files. This argument can be used with any of the other arguments. |
|
-r |
Reformats the specified name man page. Instead of being displayed, the output is captured in a file for use by subsequent man commands. |
|
-s section ... |
Search only the specified section or sections (separated by spaces). |
|
-t |
Typeset the specified name man page using troff(1). If the used with the - argument, the output is not displayed, but instead is captured in a file for subsequent use by the man command. |
|
-T macro |
Use the specified nroff(1) macro package instead of the standard man page (-man) macro package. |
The following example shows using the man command to display the man(1) man page. Note that man pages that are longer than one screen in length use the more(1) command to display one screen of the man page at a time.
# man man
Reformatting Page. Please wait... DoneUser Commands man(1)
NAME
man - find and display reference manual pagesSYNOPSIS
man [ - ] [ -adFlrt ] [ -M path ] [ -T macro-package ] [-s section ] name ...
man [ -M path ] -k keyword ...
man [ -M path ] -f file ...DESCRIPTION
The man command displays information from the reference manuals. It displays complete manual pages that you select by name, or one-line summaries selected either by keyword (-k), or by the name of an associated file (-f). If no manual page is located, man prints an error message.Source Format
Reference Manual pages are marked up with either nroff(1) or sgml(5) (Standard Generalized Markup Language) tags. The man command recognizes the type of markup and processes the file accordingly. The various source files are kept in separate directories depending on the type of markup.Location of Manual Pages
The online Reference Manual page directories are convention- ally located in /usr/share/man. The nroff sources are located in the /usr/share/man/man* directories. The SGML sources are located in the /usr/share/man/sman* directories. Each directory corresponds to a section of the manual. Since
.
.
.
A topic for showing the different man command line arguments is passwd since it is both a command, passwd(1), and a system file, passwd(4). The following example lists all man pages named passwd.
# man -l passwd
passwd (1) -M /usr/share/man
passwd (4) -M /usr/share/man#
Note that both man pages are listed. In addition an appropriate -M command line argument is displayed to show the location of the man pages. The default path name for man pages is /usr/share/man.
The following example shows displaying the passwd(1) man page.
# man passwd
Reformatting Page. Please wait... Done
User Commands passwd(1)
NAME
passwd - change login password and password attributesSYNOPSIS
passwd [ -r files | -r ldap | -r nis | -r nisplus ] [name ]
passwd [ -r files ] [ -egh ] [ name ]
passwd [ -r files ] -s [ -a ]
passwd [ -r files ] -s [ name ]
passwd [ -r files ] [ -d | -l ] [ -f ] [ -n min ] [-w warn ] [ -x max ] name
passwd -r ldap [ -egh ] [ name ]
passwd -r nis [ -egh ] [ name ]
passwd -r nisplus [ -egh ] [ -D domainname ] [ name ]
passwd -r nisplus -s [ -a ]
passwd -r nisplus [ -D domainname ] -s [ name ]
passwd -r nisplus [ -l ] [ -f ] [ -n min ] [ -w warn ] [ -x max ] [ -D domainname ] nameDESCRIPTION
The passwd command changes the password or lists password
.
.
.
Note that man -s 1 passwd would have provided the same result. In the absence of a specified section, the man pages are searched by section and the first one found is printed. To display the passwd(4) man page requires the section is be specified as in the following example.
# man -s 4 passwd
Reformatting Page. Please wait... Done
File Formats passwd(4)
NAME
passwd - password fileSYNOPSIS
/etc/passwdDESCRIPTION
/etc/passwd is a local source of information about users' accounts. The password file can be used in conjunction with other password sources, including the NIS maps passwd.byname and passwd.bygid and the NIS+ table passwd. Programs use the getpwnam(3C) routines to access this information.Each passwd entry is a single line of the form:
username:password:uid:
gid:gcos-field:home-dir:
login-shell
where
username
is the user's login name. It is recommended that this field conform to the checks performed by pwck(1M).
password
is an empty field. The encrypted password for the user is in the corresponding entry in the /etc/shadow file. pwconv(1M) relies on a special value of 'x' in the password field of /etc/passwd. If this value of 'x'
.
.
.
![]() |
Since it is difficult to remember all of the Solaris 8 commands (especially all the command line arguments), the man command provides way to get detailed information quickly. Keep in mind that there may be more than one man page with the same name, so it is important to know which section could contain the information and understand the use of the -s command line argument to specify the appropriate section. If you can't remember the man command line arguments, you can use man to display them using man man. |
The following example shows using the -a command line argument to display all passwd man pages.
# man -a passwd
Reformatting Page. Please wait... Done
::::::::::::::
/usr/share/man/cat1/passwd.1
::::::::::::::
User Commands passwd(1)NAME
passwd - change login password and password attributesSYNOPSIS
passwd [ -r files | -r ldap | -r nis | -r nisplus ] [name ]
passwd [ -r files ] [ -egh ] [ name ]
passwd [ -r files ] -s [ -a ]
passwd [ -r files ] -s [ name ]
passwd [ -r files ] [ -d | -l ] [ -f ] [ -n min ] [
-w warn ] [ -x max ] name
passwd -r ldap [ -egh ] [ name ]
passwd -r nis [ -egh ] [ name ]
passwd -r nisplus [ -egh ] [ -D domainname ] [ name ]
passwd -r nisplus -s [ -a ]
passwd -r nisplus [ -D domainname ] -s [ name ]
passwd -r nisplus [ -l ] [ -f ] [ -n min ] [ -w warn ][ -x max ] [ -D domainname ] name
.
.
.
::::::::::::::
/usr/share/man/cat4/passwd.4
::::::::::::::
File Formats passwd(4)NAME
passwd - password fileSYNOPSIS
/etc/passwdDESCRIPTION
/etc/passwd is a local source of information about users' accounts. The password file can be used in conjunction with other password sources, including the NIS maps passwd.byname and passwd.bygid and the NIS+ table passwd. Programs use the getpwnam(3C) routines to access this information.Each passwd entry is a single line of the form:
username:password:uid:
gid:gcos-field:home-dir:
login-shell
where
username is the user's login name. It is recommended that this field conform to the checks performed by pwck(1M).
password is an empty field. The encrypted password for the user is in the corresponding entry in the /etc/shadow file. pwconv(1M) relies on a special value of 'x' in the
.
.
.
Note in the previous examples (that display man pages) they begin with the phrase Reformatting Page. Please wait... Done. The man pages are actually stored as either nroff(1) source files or sgml(5) source files. To display the man pages, they are formatted "on the fly" by the nroff command. The man pages that are sgml are passed through a SGML pre-processor before being formatted by the nroff command.
Also any searches for a man page are basically "brute force". That is, each directory containing man pages is searched until the specified man page is located. To speed up displaying and searching, a pre-formatted version of the man pages can be generated and stored. The pre-formatted version is used whenever possible. Also as part of the pre-formatting process, an index of man page keywords is generated. This index, referred to as the windex database. The catman(1M) command is used to format the man pages and generate the windex database. Note that depending on the speed of the system CPU and current load, the catman command may take a significant amount of time to format all the man pages.
In addition, having the windex allows the man pages to be searched for keywords and files. The following example shows using the -f command line argument to search the man pages for references to the /etc/passwd file and the -k command line argument to search for the keyword password.
# man -f /etc/passwd
passwd passwd (1) - change login password and password attributes
passwd passwd (4) - password file# man -k passwd
d_passwd d_passwd (4) - dial-up password file
getpw getpw (3c) - get passwd entry from UID
kpasswd kpasswd (1) - change a user's Kerberos password
nispasswd nispasswd (1) - change NIS+ password information
nispasswdd rpc.nispasswdd (1m) - NIS+ password update daemon
passwd passwd (1) - change login password and password attributes
passwd passwd (4) - password file
pwconv pwconv (1m) - installs and updates /etc/shadow with information from /etc/passwd
rpc.nispasswdd rpc.nispasswdd (1m) - NIS+ password update daemon
rpc.yppasswdd rpc.yppasswdd (1m) - server for modifying NIS password file
yppasswd yppasswd (1) - change your network password in the NIS database
yppasswdd rpc.yppasswdd (1m) - server for modifying NIS password file
#
The -d command line argument can be used to view the search process as the man command attempts to locate the specified man page. The following examples shows searching the windex database. All available sections are identified in the /usr/share/man/man.cf file as a list of section identifiers that is defined as the contents of the MANSECTS variable. Each section identifier is appended to the specified man page and used to search the windex database. Note that some of the debug output has been deleted to make the example shorter.
# man -d -l passwd
/usr/share/man: from man.cf, MANSECTS=1,1m,1s,2,3,3c,3malloc,3dl,3nsl,3socket,3ldap,3krb,3nisdb,3rac,3resolv,3rpc,3slp,3xfn,3proc,3rt,3thr,3elf,3kvm,3kstat,3m,3mp,3pam,3sched,3aio,3bsm,3cpc,3sec,3secdb,3cfgadm,3crypt,3devid,3devinfo,3door,3lib,3libucb,3head,7,7d,7fs,7i,7m,7p,9,9e,9f,9s,4,5,4b,3gen,3exacct,3dmi,3snmp,3tnf,3volmgt,3mail,3layout,3ext,1b,1c,1f,3ucb,3xnet,3curses,3plot,3xcurses,3gss,6,l,n
mandir path = /usr/share/man
search in = /usr/share/man/windex file
search an entry to match passwd.1
passwd (1) -M /usr/share/man
search an entry to match passwd.1m
search an entry to match passwd.1s
search an entry to match passwd.2
search an entry to match passwd.3
search an entry to match passwd.3c
.
.
.
search an entry to match passwd.9f search an entry to match passwd.9s
search an entry to match passwd.4
passwd (4) -M /usr/share/man
search an entry to match passwd.5
search an entry to match passwd.4b
search an entry to match passwd.3gen
.
.
.
If the nroff or sgml source file for one or more manual pages are updated, the pre-formatted man page can also be updated using the -r command line argument. The following example shows creating the formatted manual page for the man command.
# man -r man
Reformatting page. Please Wait... done
#
Need To Know More?
![]() |
The Design of the Unix Operating System Maurice J., Bach |
![]() |
The Unix Programming Environment Brian W. Kernighan and Rob Pike |
![]() |
The Korn Shell: Linux and Unix Shell Programming Anatole Olczak
|
![]() |
Learning the Korn Shell Bill Rosenblatt and Mike Loukides, Mike (Editor) |
![]() |
A Practical Guide to Solaris Mark G. Sobell |
![]() |
System Reference Manual, Section 1 - User Commands Sun Microsystems |