adding directory to path code example

Example 1: 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 2: add directory to path windows 10

setx /M PATH "%PATH%;<your-new-path>"

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

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

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

nano ~/.bashrc