Get (just) the IP address in Linux


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # get IP address of eth0 network interface
  2. ifconfig eth0 | awk '/inet addr/ {split ($2,A,":"); print A[2]}'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.