I feel stupid asking, but I can't seem to find the answer to this anywhere. I'm trying to follow these instructions to edit my bash prompt, but there is no .bashrc
in either my user directory (~/.bashrc
), or in my home directory, or in the main file system directory.
There is no .bashrc
in /etc/
(there is a bash.bashrc
, however).
Do I create a .bashrc
file in my user or home directory? Is there a better, more recent set of instructions for modifying the bash prompt?
/etc/
. There should be a .bashrc file in your home directory. Try to open/edit~/.bashrc
. But before that I should also ask if you are new to Linux. If you are new to Linux, then I can post detailed instructions here..bashrc
, but you should put them in.bash_profile
Edit To clarify, don't create a.bashrc
if it's just for this, create or modify~/.bash_profile
.bash_profile
is wrong. In Ubuntu.profile
(which runs for login shells) sources.bashrc
when it's an interactive bash shell. So putting aliases in.bashrc
(or.bash_aliases
, sourced in.bashrc
) defines them in all interactive bash shells. Aliases in.bash_profile
yields this problem, and others. See this, that, this post, and the default~/.bashrc
's comments recommending putting aliases there or in.bash_aliases
..bashrc
and sourced my.bashrc
in.bash_profile
with code copied from this SuperUser answer ("Get the aliases and functions"). Thanks for correcting these commonly viewed questions Eliah, really nice answer here!