Skip to content

Instantly share code, notes, and snippets.

@tzmemo
Forked from skarllot/bashrc.sh
Created December 12, 2021 01:12
Show Gist options
  • Save tzmemo/221f9c20d2a6d4e1f9addc807b5abbb9 to your computer and use it in GitHub Desktop.
Save tzmemo/221f9c20d2a6d4e1f9addc807b5abbb9 to your computer and use it in GitHub Desktop.
Default Bash prompt (bashrc PS1)
# Each distribution default Bash prompts
# Gentoo (/etc/bash/bashrc)
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
# CentOS or Fedora (/etc/bashrc)
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
# Debian (/etc/bash.bashrc)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# References:
# https://wiki.archlinux.org/index.php/Color_Bash_Prompt
# http://wiki.centos.org/TipsAndTricks/CustomizeBash
#!/bin/bash
# Gentoo style, copy to /etc/profile.d/prompt.sh
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment