LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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

Reply
 
Search this Thread
Old 11-08-2004, 09:03 AM   #1
will103
Member
 
Registered: Mar 2004
Location: Scotland
Distribution: Ubuntu
Posts: 72

Rep: Reputation: 15
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
 
Old 11-08-2004, 09:11 AM   #2
paicolman
Member
 
Registered: Sep 2004
Location: Switzerland
Distribution: Fedora Core 2
Posts: 48

Rep: Reputation: 16
. .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.
Old 11-08-2004, 09:11 AM   #3
paicolman
Member
 
Registered: Sep 2004
Location: Switzerland
Distribution: Fedora Core 2
Posts: 48

Rep: Reputation: 16
not "not", "note"
 
Old 11-08-2004, 02:46 PM   #4
will103
Member
 
Registered: Mar 2004
Location: Scotland
Distribution: Ubuntu
Posts: 72

Original Poster
Rep: Reputation: 15
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
 
Old 11-08-2004, 02:58 PM   #5
UsualTuxpect
Member
 
Registered: Aug 2004
Location: New York
Distribution: --------- Gentoo-2004.2 [2.6.8] Redhat-9 [2.6.6]
Posts: 545

Rep: Reputation: 31
Open a new terminal session...
 
Old 11-09-2004, 12:29 AM   #6
paicolman
Member
 
Registered: Sep 2004
Location: Switzerland
Distribution: Fedora Core 2
Posts: 48

Rep: Reputation: 16
...no more ideas here. Have you checked if it excecutes the .bashrc, say via an echo "whatever" somwhere in the script?
 
Old 11-09-2004, 12:42 AM   #7
cryptwizard
Member
 
Registered: Aug 2004
Location: Sydney, Australia
Distribution: Debian Squeeze
Posts: 49

Rep: Reputation: 15
i'm pretty sure "source ~/.bashrc" will work.
but it appears a problem. try reinstalling bash.
 
Old 11-09-2004, 02:49 AM   #8
Seagull
Member
 
Registered: Oct 2003
Location: Holland
Distribution: SuSE 10.0 SuSE 10.2
Posts: 70

Rep: Reputation: 15
. ~/.bashrc works for me. Give that a try.
 
Old 11-09-2004, 07:16 AM   #9
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 11-09-2004, 04:36 PM   #10
cyberliche
Member
 
Registered: Aug 2004
Location: Atlanta
Distribution: Slackware 10
Posts: 85

Rep: Reputation: 15
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 .
 
Old 11-10-2004, 01:27 PM   #11
will103
Member
 
Registered: Mar 2004
Location: Scotland
Distribution: Ubuntu
Posts: 72

Original Poster
Rep: Reputation: 15
Thanks for all of your suggestions. I will give them a try.

Cheers

will103
 
Old 04-13-2011, 07:27 AM   #12
vgrozev
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
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
 
  


Reply


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
Configuring Bash (.bashrc) for use with Java Sir Nerdalot Linux - General 2 11-13-2005 08:42 AM
SLSE9 login issue with bash.bashrc iverger Suse/Novell 0 11-18-2004 09:43 AM
sshd won't reread the config file - Slackware 9.0 rose_bud4201 Linux - Software 6 05-03-2004 08:14 PM
/etc/profile vs. /etc/bash.bashrc jbrashear Debian 3 03-11-2004 03:49 PM
bash env vars alias's & .bashrc micxz Linux - General 8 10-08-2003 02:09 PM


All times are GMT -5. The time now is 06:29 AM.

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