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

  • 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

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
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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