|
You should find the manual pages for your system. If you are not at the computer, you can easily find them in Google.
This invocation of cut extracts the second field in a colon-delimited line (or sequence of lines, more generally). Similarly, the awk program prints the first field on a space-separated line (or sequence of lines, more generally).
Bottom line, it extracts the IP address of the interface out of the ifconfig output.
The whole process could have been done more elegantly using just ifconfig and awk, possibly at a modest decrease in maintainability, or ifconfig, grep, and two invocations of cut.
|