ifconfig not included in Ubuntu 20.04 / Hyper-V

I have a bash script that does, among other things, MY_IP="$(ifconfig en0 inet)" but apparently Ubuntu 20.04 / Hyper-V / WSL2 doesn't have ifconfig.

Is there a way to install it or do I need to rewrite my scripts to work around it? If so what would be a good way to work around it?

Thanks!

1 Answer

As per - ipconfig has been deprecated (meaning you ideally should rewrite your scripts to use IP).

That said you can "apt install net-tools" to install the old ifconfig packages, and it should "play nice".

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like