Go to main content

Troubleshooting System Administration Issues in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Solving Problems With Search Paths

When you try to access a command, you might get the wrong version of the command, or the message Command not found might display.

In order to fix a search path problem, you need to know the path name of the directory where the command is stored. Check the man page for the command to see its typical location.

Accessing an Incorrect Version of the Command

If the wrong version of the command is found, a directory including the same command name is in your search path. The correct directory might appear later in the search path or may not be included at all.

How to Diagnose and Correct Search Path Problems

  1. Determine which version of the command you are using.

    For example:

    $ which acroread 
    /usr/bin/acroread
  2. Display the current search path.
    $ echo $PATH 
  3. Check the current search path to see whether the correct directory is included and whether other directories including the same command name are listed before the correct directory.
  4. In the path listed in the .profile file in your home directory, either add the correct directory or move the correct directory to an earlier position in the path.

    Use a colon to separate path names.

  5. (Optional) If you need to use the command before your next system login, activate the new path.
    $ . $HOME/.profile
  6. (Optional) If you have activated the new path, verify that the command will be accessed through the correct path.
    $ which command

Accessing Commands That Are Not Found

The error message Command Not Found is displayed due to one of the following reasons:

  • The command is not available on the system

  • The command directory is not in the search path

If the command is not available on the system, contact your system administrator.

How to Include a Search Path in Your Path

  1. Display the current search path and make sure that the directory for the command is not in your path or that the path is not misspelled.
    echo $PATH
  2. Add the directory for the command to the PATH entry in the $HOME/.profile file.

    Use a colon to separate path names.

  3. Activate the new path.
    $ . $HOME/.profile
  4. Verify that the correct path is now displayed for the command.
    $ which command