How to know my public ip address with bash
this is a little bash script to know your public ip address
1 2 3 4 5 6 |
#!/bin/bash wget http://www.monip.org/ 2> /dev/null echo "The public ip is :" perl -ne 'print "$1\n" if m/((\d{1,3}\.){3}\d{1,3})/' < index.html rm index.html |
That’s it.
Also tagged Linux, network, Networking, script, Web