Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
Last active January 6, 2021 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tuxfight3r/409953c8d9941d36781b to your computer and use it in GitHub Desktop.
Save tuxfight3r/409953c8d9941d36781b to your computer and use it in GitHub Desktop.
Get IP/MAC from ifconfig using sed
#ifconfig | head -n2 | tr -d '\n' |sed -n 's/.*addr\s\([0-9]\{2\}:[^ ]*\).*addr:\([^ ]*\).*/mac:\1 - ip:\2\n/p'
mac:08:00:27:89:8b:8f - ip:157.203.249.51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment