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


Reply
  Search this Thread
Old 05-05-2014, 09:08 AM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Rep: Reputation: 5
Updating .bashrc file


I am playing around with aliases in the .bashrc file. After ^O and ^X, I have to logout and log back in each time to test the alias. Is there any way to update/refresh the user's .bashrc without logging out?

Thanks.
 
Old 05-05-2014, 09:19 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
yes, you open a second shell to play and take care about your original shell and original .bashrc inside (without doing anything, just in case you need to restore the original .bashrc).
 
Old 05-05-2014, 09:22 AM   #3
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 98
battles...

You just need to re-read the .bashrc file to refresh your aliases..

Code:
#cd ~
#. .bashrc

Last edited by netnix99; 05-05-2014 at 09:23 AM.
 
Old 05-05-2014, 09:24 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
Quote:
Originally Posted by netnix99 View Post
battles...

You just need to re-read the .bashrc file to refresh your aliases..

Code:
~/. .bashrc
Yes, in general, but no in some special cases - when you made a critical error inside. You would better open another shell to check if that works and leave the original intact.
 
Old 05-05-2014, 09:28 AM   #5
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Thanks. Just doing a
. .bashrc
refreshed it.
 
  


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
bashrc file LinuxUser101 Linux - Newbie 4 04-14-2008 08:55 PM
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
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 04:03 PM.

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