5 ms·
Here's what I got: ifconfig | ?{$_ -like "eth0 *"} | %{($_ -Split " ")[-1]} In other words, find the line that starts with "eth0 ", then return the last colum
by 13of40 6y ago
Here's what I got:
ifconfig | ?{$_ -like "eth0 *"} | %{($_ -Split " ")[-1]}
In other words, find the line that starts with "eth0 ", then return the last column using " " as a delimiter.