Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Created March 2, 2022 03:19
Show Gist options
  • Save zulhfreelancer/4e10c862b9bb039b1284faf45504f1c6 to your computer and use it in GitHub Desktop.
Save zulhfreelancer/4e10c862b9bb039b1284faf45504f1c6 to your computer and use it in GitHub Desktop.
Bash one-liner script to get current ISP name
# Method #1
whois $(whois $(curl -s icanhazip.com) | grep origin | awk '{print $2}') | grep -i descr | cut -d: -f2- | tail -n1 | xargs
# Method #2
whois $(whois $(curl -s icanhazip.com) | grep origin | awk '{print $2}') | grep -i 'org-name\|orgname' | cut -d: -f2- | tail -n1 | xargs
# Method #3
whois $(curl -s icanhazip.com) | grep -i 'org-name\|orgname' | cut -d: -f2- | tail -n1 | xargs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment