Skip to content

Instantly share code, notes, and snippets.

@skarllot
Last active November 29, 2024 17:56

Revisions

  1. skarllot revised this gist Nov 18, 2013. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions prompt.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/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
  2. skarllot revised this gist May 17, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bashrc.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ else
    fi


    # CentOS (/etc/bashrc)
    # CentOS or Fedora (/etc/bashrc)
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "


  3. skarllot revised this gist May 10, 2012. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions bashrc.sh
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,19 @@
    # Into /etc/bashrc or /etc/bash/bashrc
    # Each distribution default Bash prompts


    # Gentoo
    # 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
    # CentOS (/etc/bashrc)
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "


    # Debian
    # Debian (/etc/bash.bashrc)
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '


  4. skarllot renamed this gist May 10, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. skarllot revised this gist May 10, 2012. 2 changed files with 11 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions centos.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +0,0 @@
    # Into /etc/bashrc or /etc/bash/bashrc

    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
    11 changes: 11 additions & 0 deletions gentoo.sh
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,22 @@
    # Into /etc/bashrc or /etc/bash/bashrc


    # Gentoo
    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
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "


    # Debian
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '


    # References:
    # https://wiki.archlinux.org/index.php/Color_Bash_Prompt
    # http://wiki.centos.org/TipsAndTricks/CustomizeBash
  6. skarllot revised this gist May 9, 2012. 2 changed files with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions centos.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # Into /etc/bashrc or /etc/bash/bashrc

    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
    File renamed without changes.
  7. skarllot created this gist May 9, 2012.
    11 changes: 11 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # Into /etc/bashrc or /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

    # References:
    # https://wiki.archlinux.org/index.php/Color_Bash_Prompt
    # http://wiki.centos.org/TipsAndTricks/CustomizeBash