Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Grab IP address only (Linux)

# IP address
hostname -I | awk '{print $1}'
ip route get 1 | awk '{print $NF;exit}'
ifconfig | grep -m1 'inet' | awk '{print $2}'

# Public IP
curl ifconfig.me

# View RX & TX
ip -s -h a show eth0 | grep -A3 RX
Source by www.linuxtrainingacademy.com #
 
PREVIOUS NEXT
Tagged: #Grab #IP #address
ADD COMMENT
Topic
Name
4+2 =