Skip to content

Instantly share code, notes, and snippets.

@t0b1hh
Last active September 2, 2023 19:38
Show Gist options
  • Save t0b1hh/5205b7f3877be61ffabc27fc2b7db795 to your computer and use it in GitHub Desktop.
Save t0b1hh/5205b7f3877be61ffabc27fc2b7db795 to your computer and use it in GitHub Desktop.
color bash via .profile (ok and some aliases)
#!/bin/bash
alias ls='ls --color=auto'
alias l='ls -al'
alias ..='cd ..'
## colored path
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '
## colored path, username w/ red background
# PS1='\[\033[048;5;124m\]\u\[\033[1;31;0m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '
## OR
## PS1 with git branch in 2nd line:
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\]
$(git branch 2>/dev/null | grep "^*") \$ '
## OR
## PS1 with git branch in one line
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]$(git branch 2>/dev/null|grep "^*")\w\[\033[1;31m\]\$\[\033[0m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment