grep ifconfig list ips

Linux ifconfig Example

Type the following command:

ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'

FreeBSD/OpenBSD ifconfig Example

Type the following command:

ifconfig  | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'

Sun / Oracle Solaris Unix Example:

Type the following command:

ifconfig -a | grep inet | grep -v '127.0.0.1' | awk '{ print $2}'

that's how you grep ifconfig listips

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.