Changing bash profile doesn't affect new terminal windows...
Linux - NewbieThis 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!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Changing bash profile doesn't affect new terminal windows...
I'm trying to change a few things in my profile for bash, so I updated the following file...
~/.bash_profile
...from within KDE. I added the following line to display the current working directory...
PS1="["'$PWD'"] "
...and launched a new bash window, but the changes do not seem to have any affect. Although if I hit Ctrl-Alt+F2 and swith to a full screen bash window login, the changes take affect. I'm assuming that once KDE loads it must be caching the bash profile settings and uses them each time I launch a new terminal window from KDE. Is there any way to override this? I would rather use bash shell windows on the KDE desktop and not go to full screen mode using Ctrl+Alt+F2.
Also, the PS1 you have defined will not be "added", but rather will be the only thing that displays on your prompt. Is that what you intended? Probably, but when you wrote "added" it made me think you thought you were going to see what you have now plus this.
I find that I have to exit all terminals and open up a new one to see changes like this.
bash_profile is executed when the bash instance is a login shell while bashrc is started when it is non-login shell. KDE probably starts the terms as non-login shell.
The shells started from menus seem to be inconsistent in whether they are login or non-login shells. I got both types in my menu....
If you are missing ~/.bashrc you can always create one yourself. Same format as profile.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.