-
-
Save jtryan/f6fb406c2ae4f96f5c452b5a5d2a4689 to your computer and use it in GitHub Desktop.
Show host IP address on your bash prompt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show host IP address on your bash prompt. | |
# | |
# Example of prompt: | |
# | |
# [email protected] : ~/Dropbox/workspace | |
# $ | |
# | |
export PS1="\n\n\[\033[0;36m\]\u@$(ifconfig | grep "inet " | grep -v 127.0.0. | awk '{print $2}')\[\033[00m\]\[\033[0;32m\] : \w\[\033[00m\]\n\[\033[00;32m\]\$\[\033[00m\] " | |
export PS2="\[\033[0;32m\]>\[\033[00m\] " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment