dimanche 28 juin 2015

How to grep just strings "ip" into a file?

Do you guys know some other way?
I am trying to find every way to find a string in some text. I want to find more ways using grep or sed. (bear in mind It's case sensitive)
  • Every word (strings) containing string "ip" and redirect the output result in /root/found;
 grep ip /usr/share/dict/words/ > /root/found
  • Just words (strings) initiating with "ip" and redirect the output result in /root/found;
 grep ^ip  /ust/share/dict/words > /root/found 
  • Just the word "ip" and redirect the output result in /root/found;
grep ^ip$ /ust/share/dict/words > /root/found

Aucun commentaire:

Enregistrer un commentaire