Re: find function

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

 



On 16:13 23 Mar 2004, uuganbat <uuganbat@xxxxxxxxxx> wrote:
| I want to find a text from many files. How I want to find the files that
| are contain my searchin text.

Well if you have GNU grep (most Linux systems do) then:

	grep -r -l text-to-find directory-to-search

| Syntax of find is:	find path expression (example find / -name
| *.ini)

Using find, and restricting to *.ini files:

	find directory-to-search -type f -name '*.ini' -exec grep -l text-to-find {} /dev/null ';'

or:

	find directory-to-search -type f -name '*.ini' -print | xargs grep -l text-to-find /dev/null

See "man find" and "man grep" and "man xargs" to figure out how these
3 work.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

SCREECH! BUMP-BUMP! SCREECH! BUMP-BUMP! SCREECH! BUMP-BUMP! ZOOM!
   - the sound of a non-yuppie running over a show-dog
                                        -- George Scott


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux