Hacker News new | ask | show | jobs
by kps 1560 days ago

    oh-heck "Bring up the network interface. Goddamit Linux where did ifconfig go? Why do you have to NIH everything?"
3 comments

I aliased ifconfig to this:

   echo "Local IPs: " 
   ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'
   systemd-resolve --status | grep -A 2 Servers | sed 's/\ //g'
   ip route show
   curl --silent ipinfo.io | grep -E '\"ip|hostname|city' | sed 's/\"//g'

Hope this helps
Tbf, 'ip addr' is even easier to remember as far as I'm concerned
'ip a' works too
I was so happy when I discovered this. As a UNIX and Linux user for my entire career I was so surprised that something built into every Cisco, Juniper, Arista etc etc network device wasn't built into many cli tools on Linux.

I know I can create aliases and whatnot, but I'm a consultant, when I was still hands on with the tools I'd log into 30+ different customer's environments every year. Many were isolated from the Internet and whilst I did carry my dotfiles around on a USB (Along with some binaries of useful tools that are so often lacking on enterprise systems) I couldn't always use them.

How would one add this if it's missing?
busybox still has a simplified ifconfig.