LinuxQuestions.org
Help answer threads with 0 replies.
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, 10:19 PM   #1
blackzone
Member
 
Registered: Jun 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, 10:22 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
. ~/.bashrc

should do the trick. Obviously logging out and logging on will also work.
 
Old 09-20-2004, 12: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, 03: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, 04:17 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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, 07:29 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Code:
. ./.bashrc

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

Last edited by chrism01; 02-28-2013 at 07:32 PM.
 
Old 02-28-2013, 07: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, 10:27 AM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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, 10:58 AM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:39 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
Open Source Consulting | Domain Registration