UNIX / Linux set your PATH Variable Using set or export Command

http‮www//:s‬.lautturi.com
UNIX / Linux set your PATH Variable Using set or export Command

To set the PATH variable in Unix or Linux, you can use the set or export command.

The PATH variable is a list of directories that the shell searches for executables when you enter a command. By modifying the PATH variable, you can add or remove directories from the search path.

Here is an example of how you can use the set command to set the PATH variable:

set PATH=$PATH:/path/to/new/directory

This will add the directory /path/to/new/directory to the end of the PATH variable.

You can also use the export command to set the PATH variable. For example:

export PATH=$PATH:/path/to/new/directory

This will have the same effect as the set command above.

To make the change to the PATH variable permanent, you will need to add the set or export command to your shell profile. The location of the shell profile varies depending on the shell you are using. For example, in Bash, the shell profile is typically located at ~/.bashrc.

Overall, the set and export commands are useful tools for modifying the PATH variable in Unix and Linux. They allow you to customize the search path for executables and make it easier to run commands from any directory on the system.

Created Time:2017-10-30 14:27:23  Author:lautturi