Re: use grep or other command to get exactly pattern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Jan 18, 2008 12:20 PM, ann kok <annkok2001@xxxxxxxxx> wrote:
Hi all

how can use grep or use other command to get exactly
pattern eg: 10.0.0.7 only?

eg: grep 10.0.0.7 file. I want to get 10.0.0.7 only
not

10.0.0.71
10.0.0.72
10.0.0.7

thank you


     ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

If there is something else in the line in addition to 10.0.0.7
example: 10.0.0.7 word1 word2 number1...
then use
   > grep -w 10.0.0.7 myfile | awk '{print $1}'

 if 10.0.0.7 is the second field then use '{print $2}' and so on.
~af


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux