Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i have a text document that I need to pull just the IP addresses from.
I need to know what king of script or command i should use to do this.

Your requirements are very thin. But since you are using Linux, if you have a file myhosts.txt that looks like this:
10.9.6.91 fred fred.com
10.9.6.92 nails nails.com
10.9.6.43 jim jim.com
10.9.6.81 lester lester.comThe IP address is the first field. You can write a small bash script that grabs the field and prints it:
#!/bin/bash while read ipadd f2 f3 do echo $ipadd done < myhosts.txt

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |