1cbf8afb4a
- Untrack and delete compiled binaries (tarsum, gosoft.exe, rust uniq/uniq2);
ignore build outputs (dist/, bin/, *.exe, *.test, .ruff_cache/)
- Merge tools/go/ and projects/go-tools/go/ into projects/go-tools/<name>/
- Fix goipgrep .gitignore: bare 'ipgrep' pattern was ignoring cmd/ipgrep/,
so the main entrypoint was never tracked; now anchored to /ipgrep
- Archive duplicate implementations to archive/experimental/{rust,go}/
(uniq, between, tarsum rewrites); canonical versions stay in tools/
- Update README tool catalog to match new layout
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
ipgrep
Extract IP addresses (and MAC addresses) from text, with optional reachability checks, reverse DNS, and ipinfo.io lookups.
Build
./scripts/build.sh
./dist/ipgrep --help
Install (local)
./scripts/build.sh
sudo install -m 0755 ./dist/ipgrep /usr/local/bin/ipgrep
Usage
# Extract IPv4 addresses from stdin
cat file.txt | ipgrep
# Extract and uniq/sort
ipgrep -u -s file.txt
# Extract MAC addresses
ipgrep -m file.txt
# Reachability filter (auto chooses ICMP if permitted, otherwise TCP probe)
ipgrep -p file.txt
# Reverse DNS (IP only)
ipgrep -r file.txt
# Lookup ipinfo.io and output CSV (default header included)
ipgrep -l --format=csv file.txt
Notes
-p/--pingable:--ping-mode=auto(default) uses ICMP echo when raw sockets are available, otherwise falls back to a TCP connect probe.- ICMP echo typically requires root or
cap_net_rawon Linux:sudo setcap cap_net_raw+ep /path/to/ipgrep
-l/--lookupcache:- defaults to the OS cache dir (override with
--cache-path) - control size and freshness with
--cache-max-entriesand--cache-ttl
- defaults to the OS cache dir (override with
- MAC
-r/--resolveand MAC-p/--pingableare best-effort and rely on the local neighbor/ARP table:- Linux:
/proc/net/arp - Other OSes: currently unsupported without external tooling
- Linux: