Skip to content

Instantly share code, notes, and snippets.

@mikehwang
Created April 22, 2017 21:10
Show Gist options
  • Save mikehwang/248a942f1cfd5d2e5019b278618bfeca to your computer and use it in GitHub Desktop.
Save mikehwang/248a942f1cfd5d2e5019b278618bfeca to your computer and use it in GitHub Desktop.
Bashrc Tidbits

Prompt

  • Remove user and hostname
  • Show UTC datetime with the format "week of year, day of week, month, day, hour, minutes, seconds"
  • Show git branch name
PS1='$(date -u +"%U %a %m-%dT%k:%M:%S") ${debian_chroot:+($debian_chroot)}:\w $(__git_ps1 "(%s)")\$ '

Outputs

For non-git directories:

16 Sat 04-22T21:04:54 :/tmp $

For git directories:

16 Sat 04-22T21:08:56 :/tmp/vim-resurrect (master)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment