Linux Nightly published a tutorial about how to check an external IP from the command line.
Check External IP From Linux Command Line
See how to use the dig, curl, and wget Linux commands to view a system's external/public IP address from command line terminal.
Check External IP From Linux Command Line - Linux Nightly