LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Closed Thread
  Search this Thread
Old 09-19-2004, 11:19 PM   #1
blackzone
Member
 
Registered: Jul 2004
Posts: 256

Rep: Reputation: 30
reloading .bashrc file


how to reload .bashrc file without rebooting?

for example I add an alias: ls3times='ls; ls; ls' to the .bashrc file
how do I use the alias now without rebooting?
 
Old 09-19-2004, 11:22 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
. ~/.bashrc

should do the trick. Obviously logging out and logging on will also work.
 
Old 09-20-2004, 01:08 AM   #3
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
source ~/.bashrc

--Ian
 
Old 02-28-2013, 04:47 PM   #4
USmetallist
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
Wink

in Mint14 (maya) just typing "bash" works
 
Old 02-28-2013, 05:17 PM   #5
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,178
Blog Entries: 10

Rep: Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980
Quote:
Originally Posted by USmetallist View Post
in Mint14 (maya) just typing "bash" works
he said "reload"...not start a new one

Code:
source ~/.bashrc
 
Old 02-28-2013, 08:29 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Code:
. ./.bashrc

# or
. .bashrc
both rely on being in home dir

Last edited by chrism01; 02-28-2013 at 08:32 PM.
 
Old 02-28-2013, 08:49 PM   #7
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Besides source cmd, you can logout and login again, so it will load .bashrc again:
Code:
~$ exit
Then open a new terminal, if previous terminal has closed because of exit cmd, and you will see changes have taken into effect.

FYI, source command will simply recharges the executable file, so that should be the first choice.
 
Old 03-02-2013, 11:27 AM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Another option is to simply copy and run the same command in the current shell directly.

Sourcing bashrc will re-run all the commands in it, which could conceivably change something in your current environment that you want to keep. So it may be better to just run the single command you want to load, and save the full "reload" for your next session.
 
Old 03-02-2013, 11:58 AM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Moderator note: I doubt the OP is still interested in discussing a solved issue after more than 8 years! Let this thread rest in peace. Closed.
 
  


Closed Thread


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
Bashrc file Gins Linux - General 19 09-06-2005 04:19 PM
can't the file bashrc Paxmaster Linux - Software 10 01-02-2005 07:58 AM
Reloading .bashrc tbartolucci Linux - Newbie 3 07-16-2004 10:22 AM
where is the .bashrc file??? xenia Linux - Newbie 8 05-08-2004 01:11 PM
bashrc file Linvilidiot Linux - Newbie 3 03-11-2004 05:08 PM


All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration