#bash configuration file location

4 messages · Page 1 of 1 (latest)

next sigil
#

Hi. I have forgotten where the bash config file is located on my phone. Anyone know where the file is?

upper kilnBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

fickle kayak
#

Your user config file for Bash should be located at ~/.bashrc.
If that does not exist you can simply create it with your text editor of choice.

Some other ways to express that file location would be $HOME/.bashrc,
or in the case of Termux,
/data/data/com.termux/files/home/.bashrc

~ and $HOME both resolve to the user's home directory.

There is also a system bashrc, located at:

  • /etc/bash.bashrc on a "regular" Linux system
  • or $PREFIX/etc/bash.bashrc on Termux
    The absolute path to it on Termux is /data/data/com.termux/files/usr/etc/bash.bashrc

You shouldn't be using it for your personal configuration.
It's intended to set up some defaults for the distribution.
In Termux's case it just sets up shell history, a basic prompt, command-not-found and completions if bash-completion is installed.

upper kilnBOT