LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   PATH Issue (https://www.linuxquestions.org/questions/linux-newbie-8/path-issue-186333/)

Itsu 05-26-2004 10:22 PM

PATH Issue
 
As of late, I am being required to change my PATH to include some more directories. I type the following command into Bash:

Code:

$  PATH=$PATH:[Insert Dir.]
This works, however, it is temporary. Whenver I close, and then open the terminal, it reverts back to what it used to be. Why does it do this? And how to I make it permanent?

Thank you!

jeffreybluml 05-26-2004 10:34 PM

Put this in your /etc/bashrc file...

PATH=$PATH:/sbin/
PATH=$PATH:/usr/sbin/
export PATH


of course, change the paths to whichever suit you...

Now each time you open a terminal it should see this path...

Good luck!

darthtux 05-26-2004 11:07 PM

jeffreybluml is correct. Just to add: Changing the path in /etc/bashrc changes it for all users. If someone only wants to make changes for one user do the above in the users .bashrc located in their home directory.

Itsu 05-26-2004 11:36 PM

Thanks, very helpful.

mikshaw 05-27-2004 09:58 AM

You can save a line by cramming multiple paths together.
Instead of:

PATH=$PATH:/sbin/
PATH=$PATH:/usr/sbin/
export PATH

you can do:

PATH=$PATH:/sbin:/usr/sbin
export PATH

darthtux 05-27-2004 01:04 PM

You can simply it down to one line

export PATH=$PATH:/sbin:/usr/sbin

Gins 11-17-2004 11:47 AM

What is thie export command?

Is it a command or a file?

Where does it lie? I guess it is bin.

Please tell me.

Itsu 11-17-2004 12:59 PM

The export command is integrated into bash. You need to open a shell and type the command, followed by the instructions.

chin_chill 12-29-2004 05:26 PM

PATH
 
Hi,
I installed JDK1.0.5.0_01 on a Mandrake 10.1 System.
I am a Newbie but I thought I would find my way....
so first of all I edited /etc/profile and included PATH="$PATH:/usr/local/jdk1.5.0_01/bin" between umask 022 and USER='id -un'
than I restarted the session and typed: java -version
in the "normal" user mode I got the information (Version number and so on) but as root I didn't get it ( I got bash: java: command not found)
But I really need java for the root user to install OpenXchange.
Wich file do I have to edit to include the PATH for the root?

Please discribe it clearly ;-)

:newbie:

kevinalm 12-29-2004 05:47 PM

root specific bash configuration:

/root/.bash_profile and /root/.bashrc

system wide can vary but usually:

/etc/profile and /etc/bashrc

individual users:

.bash_profile and .bashrc of the users home dir.


All times are GMT -5. The time now is 07:39 AM.