Powered by Invision Power Board


  Reply to this topicStart new topicStart Poll

> How to find files containing "whateveryouwant"
fishsponge
Posted: Aug 1 2003, 08:10 AM
Quote Post


Administrator
********

Group: Admin
Posts: 679
Member No.: 1
Joined: 13-February 03



To find all files in a directory containing a string of text, you need the following command:
CODE
find . -type f | xargs grep string

find = the find command.
. = the directory you want to search in.
-type f = the type of thing you want to search for (f=files)
| xargs = pipe the output into xargs (see 'man xargs')
grep = search for...
string = the string of text you want to search for. Could also contain spaces, but remember to put it in "quotes".
PMEmail PosterUsers WebsiteICQAOLYahooMSN
Top
foobar
Posted: Sep 23 2004, 03:01 AM
Quote Post


User Level: 2
**

Group: Members
Posts: 15
Member No.: 505
Joined: 6-September 04



I'm usually just lazy and type:
grep -r "whateverstring" /path/to/dir
PMEmail Poster
Top
Squiggle
Posted: Apr 5 2005, 08:07 AM
Quote Post


Newbie
*

Group: Members
Posts: 2
Member No.: 266
Joined: 26-April 04



Wow.

I actually found this page from a google search.

Small world and all that! :P
PMEmail Poster
Top
fishsponge
Posted: Apr 8 2005, 07:51 PM
Quote Post


Administrator
********

Group: Admin
Posts: 679
Member No.: 1
Joined: 13-February 03



a good site, you see! :D
PMEmail PosterUsers WebsiteICQAOLYahooMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Tutorials & How-To's | Next Newest »

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.1619 ]   [ 12 queries used ]   [ GZIP Enabled ]




Partners: Cambridge Plus :: <Link Available> :: PIC Boot Loader :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum