On Wed, Mar 22, 2023 at 09:16:48PM +0000, Tom Furie wrote: > Or... > > ip -o a | awk '{print $2, $4}'
I think they wanted to restrict it to IPv4 (inet) addresses, and omit the netmask (/8 or whatever CIDR suffix), so: ip -o a | awk -F '[ /]*' '$3 == "inet" {print $2, $4}' But... again... why the hell would someone WANT THIS OUTPUT? What is it going to be use-- wait. I remember now. One of the posters in this thread, I think not the OP, had the word "docker" in their results. So, there's no point asking any further. Docker questions that involve shell programming are never to be entertained. It leads only to increased misery, and never increased understanding.