Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
11-08-2004, 09:03 AM
|
#1
|
Member
Registered: Mar 2004
Location: Scotland
Distribution: Ubuntu
Posts: 72
Rep:
|
How do I get Bash to reread the bashrc file?
Hi, I have a quick question regarding the Bash shell and bashrc file. If I make some changes to my bashrc file, is there a way of making Bash reread the file without quiting and restarting my terminal emulator?
Thanks in advance
will103
|
|
|
11-08-2004, 09:11 AM
|
#2
|
Member
Registered: Sep 2004
Location: Switzerland
Distribution: Fedora Core 2
Posts: 48
Rep:
|
. .bashrc
(not the space between the two dots) It reads it and applies the changes to the active shell.
|
|
1 members found this post helpful.
|
11-08-2004, 09:11 AM
|
#3
|
Member
Registered: Sep 2004
Location: Switzerland
Distribution: Fedora Core 2
Posts: 48
Rep:
|
not "not", "note"
|
|
|
11-08-2004, 02:46 PM
|
#4
|
Member
Registered: Mar 2004
Location: Scotland
Distribution: Ubuntu
Posts: 72
Original Poster
Rep:
|
Tried that but no luck. If I add an alias to my .bashrc then run the command
. .bashrc
It doesn't recognise the alias.
"source ~/.bashrc" didn't work either.
Thanks
will103
|
|
|
11-08-2004, 02:58 PM
|
#5
|
Member
Registered: Aug 2004
Location: New York
Distribution: --------- Gentoo-2004.2 [2.6.8] Redhat-9 [2.6.6]
Posts: 545
Rep:
|
Open a new terminal session...
|
|
|
11-09-2004, 12:29 AM
|
#6
|
Member
Registered: Sep 2004
Location: Switzerland
Distribution: Fedora Core 2
Posts: 48
Rep:
|
...no more ideas here. Have you checked if it excecutes the .bashrc, say via an echo "whatever" somwhere in the script?
|
|
|
11-09-2004, 12:42 AM
|
#7
|
Member
Registered: Aug 2004
Location: Sydney, Australia
Distribution: Debian Squeeze
Posts: 49
Rep:
|
i'm pretty sure "source ~/.bashrc" will work.
but it appears a problem. try reinstalling bash.
|
|
|
11-09-2004, 02:49 AM
|
#8
|
Member
Registered: Oct 2003
Location: Holland
Distribution: SuSE 10.0 SuSE 10.2
Posts: 70
Rep:
|
. ~/.bashrc works for me. Give that a try.
|
|
|
11-09-2004, 07:16 AM
|
#9
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Or you could run /bin/bash. You will be running a new shell. (a subshell actually)
Since alias definitions need only be defined once, .bash_login or .profile would be better places to put them.
Some distros source a ~/.aliases file from /etc/profile if it exists.
|
|
|
11-09-2004, 04:36 PM
|
#10
|
Member
Registered: Aug 2004
Location: Atlanta
Distribution: Slackware 10
Posts: 85
Rep:
|
Depending on the term emulator your using .bashrc might not be the file your emulator looks to for user preferences. For instance I'm using gnome (gnome-terminal) and I couldn't figure out why putting stuff in my .bashrc didn't change anything (before this I was strictly CLI only). One of my friends suggested that I make a softlink to point .bash_profile -> .bashrc .
If source .bashrc and . .bashrc don't work I'd try creating a softlink from .bash_profile -> .bashrc .
|
|
|
11-10-2004, 01:27 PM
|
#11
|
Member
Registered: Mar 2004
Location: Scotland
Distribution: Ubuntu
Posts: 72
Original Poster
Rep:
|
Thanks for all of your suggestions. I will give them a try.
Cheers
will103
|
|
|
04-13-2011, 07:27 AM
|
#12
|
LQ Newbie
Registered: Jun 2009
Posts: 2
Rep:
|
I know that this is an old thread, but wanted to clarify the fact that:
. .bashrc works correctly if executed from the directory where bashrc resides (home), if you are not in that directory then you need:
. ~/.bashrc , which is essentially the same, but with a path to the home directory provided.
Thanks,
Vlad
|
|
|
All times are GMT -5. The time now is 09:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|