Skip to content

Instantly share code, notes, and snippets.

@santaklouse
Created May 2, 2018 18:40
Show Gist options
  • Save santaklouse/8bc1d1ae732563142c6f753ddeef2081 to your computer and use it in GitHub Desktop.
Save santaklouse/8bc1d1ae732563142c6f753ddeef2081 to your computer and use it in GitHub Desktop.
bash command (script) for retrieving ip address of interface
#!/bin/bash
IFACE=$1||'eth0'
ip addr show $IFACE|fgrep 'inet '| xargs|cut -d' ' -f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment