-
Display IP address in bash shell prompt
I have seen some other methods but this is my technique using the relatively lightweight sed: Or you can use whatever interface you want instead of eth0. If left blank then it will display the first interface.