Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
2.  Logging In and Using Basic SunOS Commands Typing Commands Redirecting and Piping Command Output  Previous   Contents   Next 
   
 

Running Commands in the Background

When you type a command and press the Return key, your system runs the command, waits for the command to complete a task, and then prompts you for another command. However, some commands can take a long time to finish, and you might prefer to type other commands in the meantime. If you want to run additional commands while a previous command runs, you can run a command in the background.

If you know you want to run a command in the background, type an ampersand (&) after the command as shown in the following example.

$ bigjob &
[1] 7493
$ 

The number that follows is the process id. The command bigjob will now run in the background, and you can continue to type other commands. After the job completes, you will see a message similar to the following the next time you type another command, such as date in the following example.

$ date
Tue Oct 31 15:44:59 MST 2000
[1]    Done                 bigjob
$ 

If you plan to log off before a background job completes, use the nohup (no hangup) command to enable the job to complete, as shown in the following example. If you do not use the nohup command , the background job terminates when you log off.

$ nohup bigjob &
[3] 7495
$

Using a Password

To ensure your system's security, the Solaris operating environment requires you use a password to access your system. Changing your password several times a year helps to ensure that you are the only user with easy access to your account.


Note - If you believe someone has used your account without your permission, change your password immediately.


When you choose a password, follow these guidelines.

  • Choose a password that you can remember without writing it down. A password that you cannot remember is worse than one that is too easily guessed.

  • Choose a password that is at least six characters long and contains at least one number.

  • Don't use your own name or initials or the name or initials of your spouse.

  • Don't use the names of pets or objects common to your interests.

  • Don't use all capital letters.

  • If you have more than one account, don't use the same password for every account.

  • Avoid using the characters Ctrl-C, Ctrl-Z, Ctrl-U, Ctrl-S, Esc, Tab, #, and @ in your password. The terminal might interpret these characters as signals rather than text characters, and this interpretation would preclude you from properly typing in your password.

Changing Your Password

To change your personal password, type the passwd command:

$ passwd
passwd:  Changing password for user2
Enter login password: 
New password: 
Re-enter new password: 
passwd (SYSTEM): passwd successfully changed for user2
$ 
  1. When the system prompts you for Enter login password:, type your current password.

    If no password is currently assigned to your account, the system skips the Old Password: prompt.

    The system does not echo (display) your password on the screen and thereby prevents other users from discovering your password.

  2. When the system prompts you for New Password:, type your new password.

    Again, the password you type does not echo on the screen.

  3. At the final prompt, Re-enter new password:, type your new password a second time.

    Your system verifies that you typed the password you intended to type.

    If you do not type your password precisely the way you did at the previous prompt, the system refuses to change your password and responds with the following message:

    passwd: They don't match; try again.

    If you receive this message repeatedly, contact your system administrator to get a new password.


    Note - Passwords containing fewer than six characters are not allowed. Also, a new password must differ from the old password by at least three characters.


Password Aging

If your system uses password aging (implemented with options to the passwd command), your password can have either a maximum, or a maximum and minimum lifespan. The lifespan of your password is set by your system administrator.

When your password reaches the maturity date, your system prompts you to change your password when you log in. The following message displays.

Your password has expired. Choose a new one.

The system then automatically runs the passwd program and prompts you for a new password.

If, for example, the minimum age of your password has been set for two weeks, and you try to change your password before the minimum life span has elapsed, the following message displays.

Sorry, less than 2 weeks since the last change.

For more information on passwd(1) and password aging, refer to the man Pages(1): User Commands.

Getting Help With OS Commands

This section describes various online help features. These features enable you to view reference information from your workstation or terminal.

Displaying Manual Pages With man

If you know the name of a command, but you are not sure what it does, the man command can be helpful. Type the following to find out more about this command:

$ man man

This command displays the first part of a SunOS manual reference page in the window display area. Press the space bar to see the next screen, or press the Q key to quit and return to the command prompt. Use the man command to see all the available options and to show the proper command syntax. Manual reference pages often provide examples that illustrate various uses of the command.

Displaying a One-line Summary With whatis

If you want just a one-line summary of the command's function, use the whatis command, as shown here:

$ whatis date
date (1)           -display or set the date
$

The number in parentheses after the command name in the previous example indicates the Reference Manual section to which this command belongs. Commands are grouped into various categories according to function. Most user commands are in section 1. By common convention, the section number is displayed in parentheses after the name of the command. You can find the printed manual reference page for a command in alphabetical order within its group.


Note - The whatis command is only available if your system administrator has set up a special database of command descriptions.


Keyword Lookup With apropos

If you know what you want to do, but you do not know which command to use, use the apropos command to locate commands by keyword lookup. The apropos command lists all commands that have one-line summaries that contain any keywords you supply. The output of the apropos can be lengthy, as some keywords might appear in many places.


Note - The apropos command is only available if your system administrator has set up a special database of command descriptions.


To view examples of apropos output, type one or more of the following commands.

  • apropos who

  • apropos execute

  • apropos apropos

If you do type a keyword that generates an unreasonably lengthy display, press Ctrl-C to interrupt the display and return you to the command prompt. Hold down the Control key and press "c."

 
 
 
  Previous   Contents   Next