Get our current prompt
echo $PS1
Our prompt is defined in our shell profile file. For example .bashrc
or .zshrc
. Either navigate to where the rc file is located. Normally in the user root, or use the following command to find the file.
grep PS1 ~/.bash_profile
Common Prompts
User@Hostname
export PS1="\u@\h"
or edit the .bashrc
or .zshrc
file directly
".bashrc"
# ...PS1="\u@\h"# ...
Differentiate Root User form Normal User
A common use case is to differentiate the root user from a normal user.
export PS1="\u@\H \W:\$ "
{/* TODO:- add the success fail promp refernce- add the git branch prompt reference- add the time prompt reference- add the user@hostname prompt reference- add the path prompt reference- add the custom prompt reference*/}## Reference[how to set up linux prompt - cyberciti.biz](https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html)[Prompt Customization - archilinux.org](https://wiki.archlinux.org/title/Bash/Prompt_customization)(Deep dive.)