To know your ip address , you can use the command ifconfig
You will know the ip address for each of your network interfaces.
But if you are not directly connected to the internet and use a Gateway that’s nating the internet traffic for you , ifconfig is not going to be helpful to know the ip that connect you to the internet.
with this command the current external ip address associated with you default gateway will display
wget -qO - ident.me