Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
intf=$1
if [[ -n "$intf" ]]; then
ifconfig $intf | grep "inet addr" | cut -d: -f2 | awk '{print $1}'
else
echo "You must enter an interface name."
fi
@stondo

This comment has been minimized.

Show comment
Hide comment
@stondo

stondo Apr 18, 2016

bash script to quickly get IP of given network interface or alias.

Owner

stondo commented Apr 18, 2016

bash script to quickly get IP of given network interface or alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment