Here's a Bash function to display your public IP address and local network IP address:

function myip() {
    publicip=$(curl -s
    localip=$(ip -o -4 addr show | awk -F '[ /]+' '/global/ {print $4}')
    echo "Public IP: " $publicip
    echo "Local IP:  " $localip

Then you just need to type myip into your terminal / Bash shell and it'll show you your public IP address and your local IP address.

You could add this to your .bashrc file (eg. nano ~/.bashrc) so you always have it to use. Remember after adding it to the .bashrc file to source it to load in your changes:

. ~/.bashrc


source ~/.bashrc