This article deals with Linux based systems.
While working with a server with many IP addresses you may need to list all of the IP addresses on the server. Most commands may give you more information than you may need. To get a list of only the IP addresses use the following command:
1 |
ifconfig | awk -F "[: ]+" '/inet addr:/ { if ($4 != "127.0.0.1") print $4 }' |
The IP address available on the server will be displayed in a list like this:
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
192.168.1.6
192.168.1.7
192.168.1.8
192.168.1.9
192.168.1.10
etc…
I have found that this makes it easier to cut and paste into a text file and then later add the IPs to a database.