Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to change the location of .bashrc from /home/orhanc/.bashrc to some other directory?

share|improve this question
You can change /etc/.bashrc so that it will include the .bashrc in the special location (also different based on the users login/home directory). – Anthon Oct 29 '13 at 16:48
up vote 9 down vote accepted

Yes. You have three main options:

Symlink ~/.bashrc,

mv ~/.bashrc ~/blah && ln -s ~/blah/.bashrc ~/.bashrc

source the new file from ~/.bashrc,

mv ~/.bashrc ~/blah && cat > ~/.bashrc << 'EOF'
. ~/blah/.bashrc

or launch bash with --rcfile.

mv ~/.bashrc ~/blah
bash --rcfile ~/blah/.bashrc
share|improve this answer
Oh of course! If your couldn't tell, I'm still learning the ins and outs of using Linux and forgot about symlinks. Thank you! – OrhanC1 Oct 29 '13 at 16:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.