how to add to PATH code example

Example 1: cmd add to path

# update path only for the current session
set PATH=%PATH%;C:\your\path\here\

# update the path permanently
setx /M PATH "%PATH%;C:\your\path\here\"

Example 2: how to add a directory in path linux

# For this Purpose you have to edit ~/.bashrc file.
# So in terminal:
nano ~/.bashrc
# Now add this command to the file and instead of ADDRESS,
# write your desired address
export PATH=$PATH:ADDRESS
# Like:
export PATH=$PATH:/usr/local/hadoop

Example 3: how to add a directory to path

export PATH="$HOME/bin:$PATH"

Example 4: how to add a directory to path in linux

export PATH="$HOME/bin:$PATH"

Example 5: add to path windows

Go here

https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/

Example 6: add path to $PATH

PATH=$PATH:~/opt/bin
# or
PATH=~/opt/bin:$PATH