How can I get my IP address using Cygwin in Windows command line?

  • Thread starter Thread starter anonieko
  • Start date Start date
A

anonieko

How can I use Windows XP command line and Cygwin to get my ip address
only?
You need Cygwin since there is no equivalent cut command in Windows Command line

Step 1. Install Cygwin (grep.exe cut.exe and cygwin1.dll needed)

Step 2. Simply Type (everything is in one line)

C:\> ipconfig | grep -i 'Ip Address' | grep -v ': 19'
| grep -v ': 0.' | grep -v ': 10.' | cut -b44-
 
How can I use Windows XP command line and Cygwin to get my ip address
only?
Make sure that your cygwin bin directory, such as c:\cygwin\bin, is in
your path. Then enter:
ipconfig | grep -i 'IP Address' | cut -d: -f2
to list only your IP address.
 
Back
Top