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

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-
 
M

Michael W. Ryder

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top