How to add new path in environment variable

To add a new path to an environment variable, you can follow these steps:

Windows:

  1. Right-click on "Computer" or "This PC" and select "Properties".
  2. Click on "Advanced system settings" on the left side.
  3. Click on "Environment Variables".
  4. Under "System Variables", scroll down and find the variable you want to add the path to (e.g. PATH).
  5. Click "Edit" and then "New".
  6. Enter the new path and click "OK".
  7. Click "OK" again to close the "Environment Variables" window.

macOS (using Terminal):

  1. Open Terminal.
  2. Run the command export PATH=$PATH:/new/path (replace /new/path with the actual path you want to add).
  3. To make the change permanent, add the following line to your shell configuration file (e.g. ~/.bashrc or ~/.zshrc):
    export PATH=$PATH:/new/path
  4. Reload your shell configuration file by running source ~/.bashrc or source ~/.zshrc.

Linux (using Terminal):

  1. Open Terminal.
  2. Run the command export PATH=$PATH:/new/path (replace /new/path with the actual path you want to add).
  3. To make the change permanent, add the following line to your shell configuration file (e.g. ~/.bashrc or ~/.zshrc):
    export PATH=$PATH:/new/path
  4. Reload your shell configuration file by running source ~/.bashrc or source ~/.zshrc.

Additional tips:

After adding the new path, you should be able to access the files and executables located at that path from your terminal or command prompt.