IP2LOCATION(1)
πΈ 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.BINdata 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:ipcountry_codecountry_nameregion_namecity_nameisplatitudelongitudedomainzip_codetime_zonenet_speedidd_codearea_codeweather_station_codeweather_station_namemccmncmobile_brandelevationusage_typeaddress_typecategorydistrictasnas
-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 AND LICENSE
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
- fedora 43: IP2Location 8.7.0-1.fc43 Β· MIT
- fedora 43: IP2Location 8.7.0-1.fc43 Β· MIT
- fedora 44: IP2Location 8.7.0-3.fc44 Β· MIT
- fedora 44: IP2Location 8.7.0-3.fc44 Β· MIT
- nixos 26.05: ip2location-c 8.7.0
- nixpkgs unstable: ip2location-c 8.7.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms