Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-09-2005, 12:05 PM   #1
LQ Newbie
Registered: Oct 2004
Distribution: Debian Sarge 3.1
Posts: 21

Rep: Reputation: 15
Changing path

I am having problems changing the PATH variable permanently. I can, as should be, change it through the command line for my current bash session.

However, changing it permanently doesn't work. Changing /etc/profile doesn't give any effects at all. I can erase/comment the lines that set the PATH and no change occurs, the PATH is still the same. And, yes, I do relogin after I've made the changes. I've also restarted in case the script is executed before gdm.

If it matters I run Ubuntu 5.04.
Old 08-09-2005, 12:32 PM   #2
Registered: May 2005
Distribution: debian
Posts: 79

Rep: Reputation: 15
the .bashrc and .bash_profile in your home directory maybe overriding them. Look at those 2 files.
Old 08-09-2005, 12:45 PM   #3
LQ Newbie
Registered: Oct 2004
Distribution: Debian Sarge 3.1
Posts: 21

Original Poster
Rep: Reputation: 15
Doesn't work either. I can write whatever I want to the .bash_profile in my home directory and nothing happens.
Old 09-03-2005, 04:09 PM   #4
LQ Newbie
Registered: Jun 2005
Location: london uk
Distribution: gentoo(pc)/ubuntu(laptop)
Posts: 2

Rep: Reputation: 0
A session in Linux can be either interactive or non-interactive.
* Interactive is when you log in physically, and the environment is populated with whatever is in ~/.bash_profile and /etc/profile
* Non-interactive is like when you execute a script containing the line #!/bin/bash and this populates the environment only with ~/.bashrc and /etc/bash.bashrc

(I put all my stuff in /etc/bash.bashrc like JAVA_HOME, CLASS_PATH, etc, so I know all my programs can see all my env variables)

bashrc can be sourced from the profile, if you wish.

When making changes to your profile, it can be forced/reloaded with:

you@wherever:~$ source .bash_profile
To attach your profile to gnome-terminal:
Open a terminal. Click on Edit, Profiles..., high-light Default (or whichever you prefer), Edit, go to the Title and Command tab, and tick the box that says "Run command as login shell".

Close the terminal and start another one, and the stuff in your .bash_profile should be loaded now.

PS, also check /etc/login.defs for other options.

Last edited by opyate; 09-03-2005 at 05:30 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the login PATH cliff76 MEPIS 1 06-22-2005 03:20 PM
changing the path liljhand Linux - Software 5 01-30-2005 04:37 AM
$PATH keeps changing? linux_dejan Linux - Software 1 04-11-2004 03:32 PM
Changing the Cron Path elconde Linux - General 0 11-21-2001 05:36 PM
changing PATH toxic53 Linux - Newbie 1 09-27-2001 12:04 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration