[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


1    Getting Started

This chapter introduces the basic tasks for using the operating system. Before reading this chapter, familiarize yourself with your system's hardware components.

If you are familiar with the UNIX operating system or other operating systems, you may want to skim this chapter.

After completing this chapter, you will be able to:

To use the operating system to its full capabilities, you must learn how to create and modify files with a text editing program. See Chapter 2 for an overview of text editors, and Appendix A and Appendix B for information on the vi and ed text editors, respectively. Once you learn how to use a text editor, you should have the basic skills necessary to start using the operating system.

Security Note

If your system is running the optional enhanced security, your login and password procedures may be different than the procedures documented in this book. See the Security document for more information.


[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


1.1    Logging In

To use the operating system, your operating system must be installed and running and you must be logged in. Logging in identifies you as a valid system user and creates a work environment that belongs to you alone.

Before logging in, obtain your username and password from the system administrator. A username (typically your surname or initials) identifies you as an authorized user. A password (a group of characters that is easy for you to remember but difficult for others to guess) verifies your identity.

Think of your username and password as electronic keys that give you access to the system. When you enter your username and password during the login process, you identify yourself as an authorized user.

Your password is an important part of system security because it prevents unauthorized use of your data. For more information on passwords, see Section 1.5.1.

The first step in the login process is to display the login prompt. When your system is running and your workstation is on, the following login prompt appears on your screen:

login: 

On some systems, you may have to press the Return key a few times to display the login prompt.

Your system's login prompt screen may be somewhat different. For example, in addition to the login prompt, the screen may display the system name and the version number of the operating system.

To log in, perform the following steps:

  1. Enter your username at the login prompt. If you make a mistake, use the Delete key or Backspace key to correct it.

    For example, if your username is larry, enter:

    login:  larry

    The password prompt appears:

    login:  larry

    Password:
    

  2. Enter your password. For security reasons, the password does not display on the screen when you type it.

    If you think you made a mistake while typing your password, press the Return key. If your password is incorrect, the system displays a message and prompts you to enter your username and password again.

    After you enter your username and password correctly, the system displays the shell prompt, usually a dollar sign ($) prompt or a percent sign (%) prompt. Your system's shell prompt may be different.

    Note

    In this book, the shell prompt display is a dollar sign ($).

The shell prompt display tells you that your login is successful, and that the system is ready to go to work for you. The shell prompt is your signal that the shell is running. The shell is a program that interprets all commands you enter, runs the programs you have asked for, and sends the results to your screen. For more information about commands and the shell prompt, see Section 1.3 and Chapter 7.

When you first log in, you are automatically placed in your login directory. See Chapter 2 for information about your login directory.

If your system does not display the shell prompt, you are not logged in. You may, for example, have entered your username or your password incorrectly. Try to log in again. If you still cannot log in, see your system administrator.

Note

Your system may not require you to have a password, or you may have been assigned a password that is common to all new users. To ensure security in these cases, set your own password. For information on how to create or change a password, see Section 1.5.

Many systems display a welcome message and announcements whenever users log in. For example, the following is a typical login screen (your screen may vary):

Welcome to the Operating System
Fri Dec 7 09:48:25 EDT 19nn
You have mail.
$

The preceding announcement contains the following pieces of information:


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.2    Logging Out

When you are ready to end your work session, log out of the system. Logging out leaves the operating system running for other users and also ensures that no one else can use your work environment.

To log out, perform the following steps:

  1. Make sure that the shell prompt is displayed.

  2. Press Ctrl/D. If Ctrl/D does not work, enter the exit command.

The system displays the login prompt. On some systems, a message may also be displayed.

At this point, you or another user may log in.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.3    Using Commands

Operating system commands are programs that perform tasks on the operating system. The operating system has a large set of commands that are described in the remaining chapters of this book and in the related reference pages.

Entering a command is an interactive process. When you enter a command, the shell interprets that command, and then gives an appropriate response - that is, the system either runs the program or displays an error message.

A shell reads every command you enter and directs the operating system to do what is requested. Therefore, the shell is a command interpreter.

The shell acts as a command interpreter in the following way:

  1. The shell displays a shell prompt and waits for you to enter a command.

  2. You enter a command, the shell analyzes it, and locates the requested program.

  3. The shell asks the system to run the program, or it returns an error message.

  4. When the program completes execution, control returns to the shell, which again displays the prompt.

Figure 1-1 shows the relationship between the user, the shell, and the operating system. The shell interacts with both the user to interpret commands and with the operating system to request command execution.

Figure 1-1: Shell Interaction with the User and the Operating System

The operating system supports three different shells: the Korn, C, and Bourne shells. Your system administrator determines which shell is active when you log in for the first time. For more information about shells, see Chapter 7.

When using the operating system, enter commands at the shell prompt on the command line. For example, to display today's date and time, enter:

date

If you make a mistake while typing a command, use the Delete key or Backspace key to erase the incorrect characters and then retype them.

An argument is a string of characters that follows a command name. An argument specifies the data the command uses to complete its action. For example, the man command gives you information about operating system commands. To display complete information about the date command, enter:

man date

Commands can have options that modify the way a command works. These options are called flags and immediately follow the command name. Most commands have several flags. If you use flags with a command, arguments follow the flags on the command line.

For example, suppose that you use the -f flag with the man command. This flag displays a one-line description of a specified command. To display a one-line description of the date command, you would enter:

man -f date

While a command is running, the system does not display the shell prompt because the control passes to the program you are running. When the command completes its action, the system displays the shell prompt again, indicating that you can enter another command.

In addition to using the commands provided with the system, you can also create your own personalized commands. Refer to Section 7.10.1 for information about creating these special commands.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.4    Stopping Command Execution

If you enter a command and then decide that you do not want it to complete executing, enter Ctrl/C. The command call stops executing, and the system displays the shell prompt. You can now enter another command.

Depending upon the command, partial completion of the command may have varied results (referred to as an unknown state). To see the result of stopping a command during execution, enter Ctrl/C after executing commands such as ls -l to list files in a directory or cat filename to view a file on the screen.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.5    Setting Your Password

Your username is public information and generally does not change. Your password, on the other hand, is private.

In most instances, when your system account is established, the system administrator assigns a password that is common to new users. After getting familiar with the system, select your own password to protect your account from unauthorized access. In addition, change your password periodically to protect your data from unauthorized access.

To set your password, use the passwd command. If your account does not have a password, use the passwd command to set one. For information on passwd procedures, see Section 1.5.2.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.5.1    Password Guidelines

The following guidelines are useful in selecting a password:

On most systems, you can change your password as often or seldom as you like. However, to protect system security, your system administrator may set limits on how often you should change your password, the length of time your password remains valid, or the nature of changes you can make. Some typical password restrictions could be the following:

See your system administrator for more information about password restrictions.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.5.2    Password Procedures

To set or change your password, follow these steps:

  1. Enter the passwd command:

    passwd

    The system displays the following message (identifying you as the user) and prompts you for your old password:

    Changing password for  username
    Old password:

    If you do not have an old password, the system does not display this prompt. Go to step 3.

  2. Enter your old password. For security reasons, the system does not display your password as you enter it.

    After the system verifies your old password, it is ready to accept your new password, and displays the following prompt:

    New password:
    

  3. Enter your new password at the prompt. Remember that your new password entry does not appear on the screen.

    Finally, to verify the new password (since you cannot see it as you enter), the system prompts you to enter the new password again:

    Re-enter new password:
    

  4. Enter your new password again. As before, the new password entry does not appear on the screen. When the shell prompt returns to the screen, your new password is in effect.

If you change your password and the new password does not conform to password regulations, you receive a message stating the specific problem and the restrictions in effect for the system.

Note

Try to remember your password because you cannot log in to the system without it. If you forget your password, see your system administrator.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.6    Getting Help

Most operating system commands needed for your work are described in this book. If you want to learn more about these and other commands, see the reference pages. The reference pages are provided in three formats: online (see Section 1.6.1), Bookreader (see Chapter 5 in the Installation Guide for more information) and optionally in hard copy (see Related Documents in the About This Book section of this document). When the hard copy documents and Bookreader are unavailable, you can quickly access online command documentation by using the following commands:

The following sections describe these features.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


1.6.1    Displaying and Printing Online Reference Pages (man)

Online reference pages contain information about commands. To view a reference page online, use the man command. For example, to view the reference page for the date command, enter the following (your screen display may vary):

man date

date(1)                                                         date(1)

 
NAME date - Displays or sets the date
 
SYNOPSIS
 
Without Superuser Authority date [-u] [+field_descriptor ...]
 
With Superuser Authority date [-nu] [MMddhhmm.ssyy | alternate_date_format] [+field_descriptor ..]
 
The date command writes the current date and time to standard output.
 
DESCRIPTION
 
The date command writes the current date and time to standard output if --More--(7%)

The symbol --More--(7%) at the bottom of the page indicates that 7% of the reference page is currently displayed. At this point, you can press the Space bar to display the next screen of information, press the Return key to display one more line of information, or enter q to quit and return to the shell prompt.

Use the following command format to print a reference page:

man manpage | lpr -P printer_name

For example, to print the reference page for the date command on a specific printer, enter:

man date | lpr printer_name

The reference page for the date command is now queued for printing on printer_name. See Section 3.3 for more information about the lpr command.

To display a brief, one-line description of a command, use the man -f command. For example, to display a brief description of the who command, enter:

man -f who

who (1)    - Identifies users currently logged in
$

For complete information on the man command and its options, you can display the reference page by entering the following:

man man


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Chapter] [Index] [Help]


1.6.2    Locating Commands Using Descriptive Keywords

The apropos command and the man -k command are useful tools if you forget a command name.

Note

The apropos and the man -k commands require access to the whatis database. This database is available if your system manager loaded the default whatis database when the operating system was installed or created the database later using the catman command.

The apropos and man -k commands perform the same function. These commands allow you to enter a command description. The commands then list all the commands that fit that description.

As shown in the exammple, if a command description contains more than one word, the words must be enclosed in double quotes (" "). If the command description contains only one word, it is not necessary to enclose the descriptive word in double quotes.

Assume that you cannot remember the name of the command that displays who is logged on to the system. To display the names and descriptions of all commands that have something to do with displaying users who are logged in, enter one of the following:

apropos "logged in"

or

man -k "logged in"

The system displays:

rwho (1c)   - who is logged in on local machines
users (1)   - print names of users who are logged in
w (1)       - display who is logged in and what they are doing
who (1)     - identifies users currently logged in

Note

The numbers enclosed in parentheses refer to the section numbers of the reference pages.

After using the apropos or man -k commands, you now know that several commands: rwho, users, w, and who can be used to display the users who are logged into the system.