IP2LOCATION(1)

πŸ“¦
version 8.7.0 Β· 3 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

🌸 NAME

okay so bestie, gather round πŸ’– β€” ip2location is the command that queries IP address information from a local IP2Location BIN data file. that's it, that's the whole job, and it does it flawlessly. periodt. πŸ’…


✨ SYNOPSIS

ip2location --data-file [IP2LOCATION BIN DATA PATH] --ip [IP ADDRESS] [OPTIONS]

πŸ’– DESCRIPTION

so here's the tea, fr fr: ip2location reads an IP address β€” and yes, it takes IPv4 or IPv6 address format, we're inclusive here πŸ¦‹ β€” and then it goes and pulls the info out of an IP2Location BIN data file so it can show it to you. that's the whole main character arc. πŸ‘‘

and like, you're not stuck typing IPs one by one either. you can hand it the IP address as standard input, or point it at a file containing one IP address per line. group-chat energy, one IP per message, you know how it is. πŸ™ˆ

it also speaks several output formats, so pick your aesthetic: CSV, TAB and XML. slay. ✨

you can download the IP2Location BIN data file from http://www.ip2location.com or http://lite.ip2location.com β€” go get your data, bestie, it's not gonna download itself. πŸŽ€


πŸŽ€ EXAMPLES

✨ query one IP, get results on screen

ip2location --data-file [IP2LOCATION BIN DATA PATH] --ip [IP ADDRESS]

Query an IP address and display the results on screen β€” the classic. the starter pack. πŸ“

πŸ’œ query a whole file of IPs

ip2location --data-file [IP2LOCATION BIN DATA PATH] --input-file [INPUT FILE PATH]

Query all IP addresses from an input file and display the results on screen β€” batch mode, lowkey efficient. πŸ’…

🌈 same thing but make it XML

ip2location --data-file [IP2LOCATION BIN DATA PATH] --input-file [INPUT FILE PATH] --format XML

Query all IP addresses from an input file and display the results in XML format on screen β€” tags on tags on tags. ✨

πŸ¦‹ TAB format, but write it to a file

ip2location --data-file [IP2LOCATION BIN DATA PATH] --input-file [INPUT FILE PATH] --format TAB --output-file [OUTPUT FILE PATH]

Query all IP addresses from an input file and output the result to a file in TAB format β€” save it for later, queen. πŸ‘‘

🌸 one IP, one field, no heading

ip2location --data-file [IP2LOCATION BIN DATA PATH] --ip [IP ADDRESS] --field country_code -0-heading

Query an IP address and display the country_short result β€” minimal, clean, obsessed. πŸ’–

⭐ two fields, TAB, still no heading

ip2location --data-file [IP2LOCATION BIN DATA PATH] --ip [IP ADDRESS] --field country_code,city_name -0-heading --format TAB

Query an IP address and display the country_short and city result β€” now we're cooking. πŸ”₯


πŸ‘‘ OPTIONS

  • -b, --bin-version β€” print the IP2Location BIN database version. the data file's lil birth certificate. πŸŽ€
  • -d, --data-file β€” specify the path of the IP2Location .BIN data file. this is the file, you need it. 🫢
  • -i, --input-file β€” specify an input file with IP address list. one IP per line, bestie.
  • -p, --ip β€” specify an IP address query (supported IPv4 and IPv6 address). 🌈
  • -o, --output-file β€” specify output file for query results. where the results go to live their life. ✨
  • -f, --format β€” specify output format. supported formats are:
    • CSV (default) β€” the no-thoughts-just-vibes choice
    • TAB
    • XML
  • -h, -?, --help β€” display this help file. we love a helpful icon. πŸ’…
  • -v, --version β€” display the version number.
  • -e, --field β€” specify the field to be displayed. supported values are:
    • ip
    • country_code
    • country_name
    • region_name
    • city_name
    • isp
    • latitude
    • longitude
    • domain
    • zip_code
    • time_zone
    • net_speed
    • idd_code
    • area_code
    • weather_station_code
    • weather_station_name
    • mcc
    • mnc
    • mobile_brand
    • elevation
    • usage_type
    • address_type
    • category
    • district
    • asn
    • as
  • -n, -0-heading β€” suppress the heading display. bye bye header row, we barely knew ye. πŸ’€

🫢 AUTHORS

this tool was created by IP2Location (https://www.ip2location.com). give them their flowers, they earned them. 🌸


Copyright 2001-2024 IP2Location.com

this tool is licensed under MIT. go wild, just be cool about it. πŸŽ€


okay so that's the whole page, bestie πŸ’– this was IP2LOCATION(1), living in the General Commands Manual, and the footer is literally just IP2LOCATION(1) again because the page said everything it needed to say. no notes. iconic. slay. πŸ¦‹βœ¨

πŸ“¦ where this page comes from