I use a quick search tool at my registrar,
rebel.com.
For any given string of characters, it will instantly check its availability in many, many TLDs - generic ones and country ones being sold as generics - and provide availability and pricing.
(including when a TLD marks a string as "premium" so the registry can earn the speculation bonus instead of a reseller)
It just checks whether the domains are taken, not whether or how they're in use. I know it's not CLI; you may get better results using `dig` than `ping` or `whois` if going that route.
- Evan