《问》How to change bash prompt on MacOS?
《问》
How to change bash prompt on MacOS?Examples
show my working directory basename
echo "export PS1='|\W| \$ '" >> ~/.bash_profile
. ~/.bash_profile
show my working directory path
echo "export PS1='|\w| \$ '" >> ~/.bash_profile
. ~/.bash_profile
my favourite
export PS1="\e[0;31m\u@\H\e[m\e[0;34m:[\W]\e[m\e[0;31m\$ \e[m"
Comments