commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Require "grep -P" ( pcre ).
If you don't have grep -P, use that :
grep -Eo '"url":"[^"]+' $(ls -t ~/.mozilla/firefox/*/sessionstore.js | sed q) | cut -d'"' -f4
Like the tiltle said, you can use an argument too ( the interface )
will show only the IP of this interface and the public IP
( tested with Linux )
You can add that function in ~/.bashrc, then
Now you are ready to call this function in all your terms...