对给定的IP地址进行地理定位

抓取ip2location站点,并移除除了包含国家/地区值的span标记之外的所有内容。将其放在.bashrc或.bash_aliases文件中。
.

0

linux命令:ip2loc() { wget -qO - www.ip2location.com/$1 | grep "<span id=\"dgLookup__ctl2_lblICountry\">" | sed 's/<[^>]*>//g; s/^[\t]*//; s/&quot;/"/g; s/</</g; s/>/>/g; s/&amp;/\&/g'; } } s/&amp;/\&/g'; s/>/>/g; s/</</g; s/&quot;/"/g; s/^[\t]*//; 's/<[^>]*>//g; sed | id=\"dgLookup__ctl2_lblICountry\">" "<span grep | www.ip2location.com/$1 - -qO wget { ip2loc() ip2loc() { wget -qO - www.ip2location.com/$1 | grep "<span id=\"dgLookup__ctl2_lblICountry\">" | sed 's/<[^>]*>//g; s/^[\t]*//; s/&quot;/"/g; s/</</g; s/>/>/g; s/&amp;/\&/g'; }rootopen.com
linux命令:ip2loc() { wget -qO - www.ip2location.com/$1 | grep "<span id=\"dgLookup__ctl2_lblICountry\">" | sed 's/<[^>]*>//g; s/^[\t]*//; s/&quot;/"/g; s/</</g; s/>/>/g; s/&amp;/\&/g'; } } s/&amp;/\&/g'; s/>/>/g; s/</</g; s/&quot;/"/g; s/^[\t]*//; 's/<[^>]*>//g; sed | id=\"dgLookup__ctl2_lblICountry\">" "<span grep | www.ip2location.com/$1 - -qO wget { ip2loc() ip2loc() { wget -qO - www.ip2location.com/$1 | grep "<span id=\"dgLookup__ctl2_lblICountry\">" | sed 's/<[^>]*>//g; s/^[\t]*//; s/&quot;/"/g; s/</</g; s/>/>/g; s/&amp;/\&/g'; }rootopen.com
jhgo 2018-03-26 19:45:48
输出

评论

相关推荐
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

热门文章