Pages

Wednesday, September 3, 2014

Print the IP address and the Mac address in the same line

$ ifconfig | head -n 2 | tr -d '\n' | sed -n 's/.*\(00:[^ ]*\).*\(adr:[^ ]*\).*/mac:\1 - \2/p'

Print the IP address and the Mac address in the same line




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/1nWz5i6

No comments:

Post a Comment