Command equivalent to 'hostname' in Windows

1

Is there a command in Windows that is equivalent to the hostname -I of Linux? I just need you to give me back the same information. Thank you very much.

    
asked by Raul Norberto Confalonieri 22.12.2017 в 16:15
source

2 answers

1

In Windows it is the same command:

hostname 

(without parameters to get the name of your team)

ipconfig /all 

(to get all the ips and routes associated with your team)

    
answered by 27.12.2017 в 22:36
0

If you are looking to get only the IP of the computer, you can do this:

for /f "tokens=2 delims=:" %i  in ('ipconfig ^| findstr /i "IPv4 Address." ^| findstr [1-9]') do echo %i
    
answered by 22.12.2017 в 19:23