← 返回命令列表

Linux command

ipinfo 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Look up your own IP address

ipinfo myip

Look up details for a specific IP address

ipinfo [8.8.8.8]

Look up ASN information

ipinfo [AS15169]

Bulk lookup

ipinfo bulk [1.1.1.0/30] [8.8.8.8]

Extract a specific field

ipinfo [8.8.8.8] -f [city]

Output in CSV format

cat ips.txt | ipinfo -c

Authenticate with an API token

ipinfo init [your_token]

Summarize details for a list of IPs

cat ips.txt | ipinfo summarize

说明

ipinfo is the official command-line client for the IPinfo.io API. It returns IP intelligence data including geographic location, ISP, organization, ASN, hostname, and abuse contact information. The tool accepts IP addresses (IPv4/IPv6), ASNs, and CIDR ranges. Multiple inputs can be queried at once or piped in from another command. Output can be rendered as human-readable text, JSON, or CSV, and specific fields can be extracted for use in scripts. The CLI ships with several helper binaries such as grepip, prips, cidr2range, cidr2ip, range2cidr, and mmdb for working with IP lists and MMDB databases.

参数

init _token_
Save an API token for authenticated requests.
myip
Look up details for your own IP address.
bulk _ips_
Process multiple IPs or CIDR ranges.
summarize _ips_
Produce a summary report for a list of IPs.
-f, --field _FIELD_
Return only the specified field (e.g., ip, city, region, country, org, hostname).
-c, --csv
Output results in CSV format.
--nocolor
Disable colored output (or set the `NO_COLOR` environment variable).
--token _TOKEN_
Pass an API token for this invocation.
completion
Generate shell completions (bash, zsh, fish).
-h, --help
Display help information.
-v, --version
Display version information.

FAQ

What is the ipinfo command used for?

ipinfo is the official command-line client for the IPinfo.io API. It returns IP intelligence data including geographic location, ISP, organization, ASN, hostname, and abuse contact information. The tool accepts IP addresses (IPv4/IPv6), ASNs, and CIDR ranges. Multiple inputs can be queried at once or piped in from another command. Output can be rendered as human-readable text, JSON, or CSV, and specific fields can be extracted for use in scripts. The CLI ships with several helper binaries such as grepip, prips, cidr2range, cidr2ip, range2cidr, and mmdb for working with IP lists and MMDB databases.

How do I run a basic ipinfo example?

Run `ipinfo myip` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init _token_ do in ipinfo?

Save an API token for authenticated requests.