1830060 Members
2560 Online
109998 Solutions
New Discussion

find text on file

 
SOLVED
Go to solution
Tonatiuh
Super Advisor

find text on file

Red Hat Enterprise Linux.

How can I find certain text into a file, without open the file?
2 REPLIES 2
Ivan Ferreira
Honored Contributor
Solution

Re: find text on file

Very easy, use:

grep "text to find" filename
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rasheed Tamton
Honored Contributor

Re: find text on file

grep "text" filename (as the above).

grep -i text filename (grep with -i option can be used to search case insensitive texts, i.e., lower or upper case letters).

grep Tona filename (will find your name from the file called filename)
grep -i tona filename (will also find the same).

Regards,
Rasheed Tamton.