Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

470
Views
How to add multiple path in $PATH variable linux?

I want to add multiple path in $path variable like java path and php path . how to do that in linux?

I am doing something in bash_profile like :

PATH=$JAVA_HOME/bin:$PATH:/usr/java/jdk1.7.0_45/bin/:$AWS_AUTO_SCALING_HOME/bin 
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

$PATH can have several paths separated by a colon (:). E.g.:

export PATH=/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/myuser/bin
over 4 years ago · Santiago Trujillo Report

0

Set the $PATH environment variable to include the directory where you installed the bin directory with shell scripts and two consecutive export entries as in example.

Example:

export ANT_HOME=/path/to/ant/dir
export PATH=${PATH}:${ANT_HOME}/bin:${JAVA_HOME}/bin

To make them permanent entries update the bash_profile file.

over 4 years ago · Santiago Trujillo Report

0

One way to add multiple executables to the $PATH variable is:

export PATH=/path/to/executable1:\
/path/to/executable2:\
/path/to/executable3:\
/path/to/executable4

If a $PATH already exists in .bash_profile, and you want them to take precedence over executables (like java and php), you can do:

export PATH=$PATH:/path/to/executable1:\
/path/to/executable2:\
/path/to/executable3:\
/path/to/executable4

If the path to any executable contains whitespaces, add the part / ... executableX in quotes.

Once you're done making changes in your bash_profile, source the file in a terminal session so that changes are effective immediately:

source .bash_profile
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!