how to get public ip using tor

hi all,
i want to get my real ip from tor client real ip not tor ip how can i do that and is there any flag to pass to tor to print my ip?

Documented here just now:
Logging into Captive Portals‎ chapter Find out real IP Address from inside Whonix-Gateway in Whonix wiki

can you add more details of what is “tor-ctrl” and how to install it and how it works in low level withtor package?

Control and Monitor Tor chapter tor-ctrl in Whonix wiki