LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Updating .bashrc file (https://www.linuxquestions.org/questions/linux-newbie-8/updating-bashrc-file-4175503974/)

battles 05-05-2014 08:08 AM

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.

pan64 05-05-2014 08:19 AM

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).

netnix99 05-05-2014 08:22 AM

battles...

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

Code:

#cd ~
#. .bashrc


pan64 05-05-2014 08:24 AM

Quote:

Originally Posted by netnix99 (Post 5164914)
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.

battles 05-05-2014 08:28 AM

Thanks. Just doing a
. .bashrc
refreshed it.


All times are GMT -5. The time now is 03:25 PM.