# whois

Lookup which ASN an IP address belongs to

whois -h whois.cymru.com $IP_ADDRESS

Create a command alias in your preferred shell environment alias asn="whois -h whois.cymru.com" and then use asn $IP_ADDRESS instead.