JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Advanced Administration
search filter icon
search icon

Document Information


1.  Managing Terminals and Modems (Overview)

2.  Setting Up Terminals and Modems (Tasks)

3.  Managing Serial Ports With the Service Access Facility (Tasks)

4.  Managing System Resources (Overview)

5.  Displaying and Changing System Information (Tasks)

6.  Managing Disk Use (Tasks)

7.  Managing UFS Quotas (Tasks)

8.  Scheduling System Tasks (Tasks)

9.  Managing System Accounting (Tasks)

10.  System Accounting (Reference)

11.  Managing System Performance (Overview)

12.  Managing System Processes (Tasks)

13.  Monitoring System Performance (Tasks)

14.  Troubleshooting Software Problems (Overview)

15.  Managing System Messages

16.  Managing Core Files (Tasks)

17.  Managing System Crash Information (Tasks)

18.  Troubleshooting Miscellaneous Software Problems (Tasks)

19.  Troubleshooting File Access Problems (Tasks)

Solving Problems With Search Paths (Command not found)

How to Diagnose and Correct Search Path Problems

Solving File Access Problems

Changing File and Group Ownerships

Recognizing Problems With Network Access

20.  Resolving UFS File System Inconsistencies (Tasks)

21.  Troubleshooting Software Package Problems (Tasks)


Solving Problems With Search Paths (Command not found)

A message of Command not found indicates one of the following:

To fix a search path problem, you need to know the pathname of the directory where the command is stored.

If the wrong version of the command is found, a directory that has a command of the same name is in the search path. In this case, the proper directory may be later in the search path or may not be present at all.

You can display your current search path by using the echo $PATH command. For example:

$ echo $PATH 

Use the which command to determine whether you are running the wrong version of the command. For example:

$ which acroread 

Note - The which command looks in the .cshrc file for path information. The which command might give misleading results if you execute it from the Bourne or Korn shell and you have a .cshrc file than contains aliases for the which command. To ensure accurate results, use the which command in a C shell, or, in the Korn shell, use the whence command.

How to Diagnose and Correct Search Path Problems

  1. Display the current search path to verify that the directory for the command is not in your path or that it isn't misspelled.
    $ echo $PATH 
  2. Check the following:
    • Is the search path correct?

    • Is the search path listed before other search paths where another version of the command is found?

    • Is the command in one of the search paths?

    If the path needs correction, go to step 3. Otherwise, go to step 4.

  3. Add the path to the appropriate file, as shown in this table.
    Bourne and Korn
    $ PATH=$HOME/bin:/sbin:/usr/local /bin ...

    $ export PATH

    A colon separates path names.



    hostname% set path=(~bin /sbin /usr/local/bin ...)
    A blank space separates path names.
  4. Activate the new path as follows:
    File Where Path Is Located
    Use this Command to Activate The Path
    Bourne and Korn
    $ . ./.profile
    hostname% source .cshrc
    hostname% source .login
  5. Verify the new path.
    $ which command

Example 19-1 Diagnosing and Correcting Search Path Problems

This example shows that the mytool executable is not in any of the directories in the search path using the which command.

venus% mytool
mytool: Command not found
venus% which mytool
no mytool in /sbin /usr/sbin /usr/bin /etc /home/ignatz/bin  .
venus% echo $PATH
/sbin /usr/sbin /usr/bin /etc /home/ignatz/bin
venus% vi ~/.cshrc
(Add appropriate command directory to the search path)
venus% source .cshrc
venus% mytool

If you cannot find a command, look at the man page for its directory path. For example, if you cannot find the lpsched command (the lp printer daemon), the lpsched(1M) man page tells you the path is /usr/lib/lp/lpsched.