There is a quick cli command to determine the external IP address of your Debian machine through the command-line interface.
If you are connected behind a router, then the ifconfig command will give you the internal ip address of your machine.
You can ask some website what your public IP address is using curl and extract the information you need by issuing the following command.
or even shorter:
that’s all !