Creo que esta es la parte relevante de mi ~/.bashrc
archivo:
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
(Olvidé de dónde saqué esto, así que lamentablemente no puedo dar crédito a la fuente). Esta es la única aparición de la línea alias ls='ls --color=auto'
en el ~/.bashrc
archivo.
La molestia es: cada vez que abro un mensaje/terminal/bash, el terminal hace eco
alias ls='ls --color=auto'
(¡pero no los demás!) Me gustaría eliminar esta notificación.
Editar:Aquí están los otros profile
archivos que puedo encontrar en el sistema.
#~/.bash_profile
#!/bin/bash
echo "You've got rhythm. You've got music. Anything else?"
#~/.profile
#unmask 022
if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
#/etc/profile
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
Respuesta1
Encontré la solución aquí:https://stackoverflow.com/questions/9652126/bashrc-profile-is-not-loaded-on-new-tmux-session-or-window-whyy aquí:https://apple.stackexchange.com/questions/12993/why-doesnt-bashrc-run-automatically
Necesitaba agregar source ~/.bashrc
al final de mi .bash_profile
.