ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to grep a ip adress from the file mentioned below using wildcards.
The ip adresss can be like this,
10.211.32.3
192.168.1.1
132.213.231.312
the number of octets vaires for each..
-------------------------------
cat fileone
Keyboarders normally indent paragraphs three to five word spaces.based on what they were taught in school.while professionally printed material such as books and magazines generally use smaller indents.[citation needed] The Elements of Typographic Style states that "at least one 10.211.32.3 en [space]" should be used to indent paragraphs after the first,[6] noting that that is the "practical minimum".[7] An em space is the 192.168.1.1 most commonly used paragraph indent.[8] Miles Tinker, in his book Legibility of Print, concluded that indenting the first line of paragraphs increases readability by 7%, on the average.[9] 132.213.231.312
-------------------------------
So my task here is that, i need to get all the ip addresses in the above paragraph...
See "man grep" for an explanation of -w and -o. The regular expression is a bit too tolerant (for example, it would also match "1000.0.0.0"), but that should not be a problem in practice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.