/sbin/ifconfig | Grep-a1 ' ^eth1 ' | grep ' inet addr: ' | Awk-f: ' {print $} ' | awk ' {print $} ' | Grep-e ' ^10\.| ^172\.| ^192\. ' | Head-n1
Analysis of each parameter
/sbin/ifconfig display information for all IP addresses
Grep-a1 ' ^eth1 ' filters out two lines that start with eht1
grep ' inet addr: ' In the information selected in the last step of the race, further races are selected to inet addr:
Awk-f: ' {print $} ' to: Print the second field for the split symbol, inet addr:10.12.193.226 bcast:10.12.193.255 mask:255.255.255.0, where the first field is inet add R: The second one is
10.12.193.226 Bcast
awk ' {print '} ' continues to filter further in the information from the previous step, where the default is to use a space as a separator, and to output the first field 10.12.193.226
Grep-e ' ^10\.| ^172\.| ^192\. ' This is to filter the IP address that starts with 10, 172, 192, | This is or is meant to be,------------This parameter indicates that the regular expression
HEAD-N1 Output First line