Files and shell

Add a folder to your PATH

Make the programs in a folder runnable from anywhere, for good, not just in this terminal.

Fill these in once
  1. Add it to your shell settings and load them
    Terminal
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc

Check it worked

  1. Check it's there
    Terminal
    echo $PATH | tr ':' '\n'
Undo it
  1. Open the settings file and delete that line
    Terminal
    open -e ~/.zshrc
  1. Add it to your shell settings and load them
    Terminal · Ubuntu / Debian
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
    source ~/.bashrc

Check it worked

  1. Check it's there
    Terminal · Ubuntu / Debian
    echo $PATH | tr ':' '\n'
Undo it
  1. Open the settings file and delete that line
    Terminal · Ubuntu / Debian
    nano ~/.bashrc
  1. Add it to your user PATH
    PowerShell
    [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";C:\tools", "User")

    Close and reopen PowerShell afterwards.

Check it worked

  1. Check it's there
    PowerShell
    $env:Path -split ';'
Undo it
  1. Remove it again
    PowerShell
    [Environment]::SetEnvironmentVariable("Path", (([Environment]::GetEnvironmentVariable("Path", "User") -split ";") | Where-Object { $_ -ne "C:\tools" }) -join ";", "User")