LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Add the xyz directory to your path (what path?) (https://www.linuxquestions.org/questions/linux-newbie-8/add-the-xyz-directory-to-your-path-what-path-948882/)

Eerie 06-06-2012 04:14 PM

Add the xyz directory to your path (what path?)
 
I'm trying to install apache-ant at the moment and among the installation instructions is

"Add the bin directory to your path."

This isn't the first time I've come across this mysterious "path". What are they talking about?
should I just updatedb? do I have to put it in my fstab? what is required of me here?

camorri 06-06-2012 04:21 PM

They are talking about what directories the system will look through for your executable program.

The trick here is to find out what your 'path' is. The command is 'echo $PATH' enter the command without quotes in a terminal.

Here is what my system returns.

Quote:

echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/java/bin:/usr/lib64/kde4/libexec:/opt/kde3/lib64/qt3/bin:/opt/kde3/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.
So, if the executable is in /usr/local/bin or /usr/bin or /usr/games and the list goes on, the command will be found. If it is not in one of these directories, I can either update the path, or put a symlink in the path to the executable.

Hope this helps.

suicidaleggroll 06-06-2012 04:30 PM

As camorri said, the "path" is your PATH environment variable.

To add a directory to the path, stick the following in your startup script (depends on shell, for BASH it's usually ~/.bashrc):
Code:

export PATH=${PATH}:/path/to/new/directory

Eerie 06-06-2012 04:48 PM

thanks that solves it.


All times are GMT -5. The time now is 05:57 PM.