add to path linux code example

Example 1: linux add to path

export PATH=$PATH:/place/with/the/file

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 in linux

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

Example 4: ubuntu export path

export PATH="/path/to/dir:$PATH"

Example 5: add pwd to path linux

$ echo "export PATH=\$PATH:$(pwd)" >> ~/.bashrc

Example 6: how to add a path variables in linux

export PATH=/usr/java/<JDK Directory>/bin:$PATH.