ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Using GREP to Find an IP Address

    IT Discussion
    bash regular expression regex shell unix linux grep
    1
    1
    1.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      This is one that I need from time to time but there is no reasonable way to remember. Grep for IP Address. In case you ever need it, here it is:

      grep -E '.*((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])'
      

      Reference from here: http://www.skrakes.com/2010/03/03/grep-ip-address

      1 Reply Last reply Reply Quote 3
      • 1 / 1
      • First post
        Last post