DataMoney.net

Linux-Ubuntu-Centos-Mac-查看服务器ip

andy发表:

#>0思路
	命令行查网卡信息.还有你都有公网了,找第三方的api查.建议做成自定义命令方便使用.	#>1系统自带的命令行
	
ip addr|grep inet|grep global
#>2linux-全部可用
ifconfig
#>3第三方api curl ifconfig.me//提供服务的这类服务的比较多, 把上面的url换成, tool.lu/ip, https://www.ip.cn等等.如果你有给我分享哈~ #>4mac osx本机专用的. brew install archey这个在mac本机使用相当舒服务 #5最好是加个自定义命令,下回能用是吧.
echo alias myip="curl http://www.ifconfig.me" >> ~/.bashrc && source ~/.bashrc