Skip to content

Instantly share code, notes, and snippets.

@lukewendling
Created July 4, 2020 11:45
Show Gist options
  • Save lukewendling/82d72332eac947d6397702927e35fafb to your computer and use it in GitHub Desktop.
Save lukewendling/82d72332eac947d6397702927e35fafb to your computer and use it in GitHub Desktop.
short colorful bash prompt
# Prompt format: username:os:currentdir>
# luke:debian10:myapps>
CURR_DIR=$(basename "$PWD")
ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:$ID$VERSION:\[\033[01;34m\]${CURR_DIR}\[\033[00m\]> '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment