guest@dotshare [~/groups/shells/bash] $ ls simple-and-good/ | cat

simple and good (scrot, raw, dl)

daaug May 16, 2019 (shells/bash)

SCROT

1
2
3
4
5
parse_git_branch() {
             git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

PS1='\033[1;33m(\t)\033[m \033[1;36m[ \u |\033[m \033[1;32m\W\033[m \033[1;36m]\033[m $(parse_git_branch)\n> '

CLICK TO VIEW

x

Notes

Hey guys!

This is my personal bash config! I like it so much so I decide to share.it with you all.

This config show you the clock, user, current folder (not full path) and the git repository.

Some notes (for newbies, like me):

  • Comment the “PS1” line and paste the code (the PS1 line) after it;
  • If you use some kind of terminal theme, the color can be different than I show here.

Thats it!

Thanks!


Som refs:

https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt
https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/
http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux