PATH environment variable is used to locate commands within the SunOS directory hierarchy. By setting the
PATH, you create a fixed set of directories that the system always searches whenever you type the name of a command.
For example, if you have no
PATH variable set and you want to copy a file, you need to type the full path name for the command, /usr/bin/cp. However, if you have set the
PATH variable to include the directory /usr/bin, then you can simply type cp and your system will always execute the command. This is because your system searches for the cp command in every directory that is named in the
PATH variable, and executes it when it is found. You can significantly streamline your work by using the
PATH variable to list the commonly used SunOS
For the Bourne, Bourne Again, and Korn shells, you can specify the
PATH variable in your user profile file (in your home directory) by using the following syntax.
In the previous example, home represents the path name of your home directory.
For the C, TC, and Z shells, you can specify the
PATH variable in your user profile file (in your home directory) by using the following syntax:
set path=(/usr/bin home/bin .)
In this command, home is the path name of your home directory.
example% source user-profile-file