FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 10-03-2008, 01:54 PM
"Bo Lynch"
 
Default find

On Fri, October 3, 2008 10:00 am, tony.chamberlain@lemko.com wrote:
>
> I am looking for something similar to the windows SEARCH FILES comman
> with the option "files containing ..." (that is where I can specify a
> string and it will find all files containing that string -- not just
> having
> the string as part of the name but actually containing it in the text).
>
> Is there some way to do this?
>
>
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>

I would recommend taking a look at grep. THere are many ways you can use it.
Bo

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:00 PM
 
Default find

I am looking for something similar to the windows SEARCH FILES comman
with the option "files containing ..." (that is where I can specify a
string and it will find all files containing that string -- not just having
the string as part of the name but actually containing it in the text).

Is there some way to do this?


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:04 PM
Pintér Tibor
 
Default find

tony.chamberlain@lemko.com írta:

I am looking for something similar to the windows SEARCH FILES comman
with the option "files containing ..." (that is where I can specify a
string and it will find all files containing that string -- not just having

the string as part of the name but actually containing it in the text).

Is there some way to do this?


exec + *grep ?

t
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:04 PM
Niki Kovacs
 
Default find

tony.chamberlain@lemko.com a écrit :

I am looking for something similar to the windows SEARCH FILES comman
with the option "files containing ..." (that is where I can specify a
string and it will find all files containing that string -- not just having

the string as part of the name but actually containing it in the text).

Is there some way to do this?

grep is your friend. Let's say you are looking for the character string
'UserDir' below your /etc directory. Then you would simply do:


[root@grossebertha ~]# grep -R UserDir /etc/

Give it a try!

Niki
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:07 PM
Rainer Duffner
 
Default find

tony.chamberlain@lemko.com schrieb:
> I am looking for something similar to the windows SEARCH FILES comman
> with the option "files containing ..." (that is where I can specify a
> string and it will find all files containing that string -- not just having
> the string as part of the name but actually containing it in the text).
>
> Is there some way to do this?
>
>


You could use "glimpse" for that.
Or google desktop ;-)

The problem is that preparing the index takes a lot of time.
And more than 95 time out of 100, you don't need it anyway.
(On a server, because man -k and locate already do a good job of making
the relevant stuff available to you quickly).




Rainer
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:08 PM
Ned Slider
 
Default find

tony.chamberlain@lemko.com wrote:

I am looking for something similar to the windows SEARCH FILES comman
with the option "files containing ..." (that is where I can specify a
string and it will find all files containing that string -- not just having

the string as part of the name but actually containing it in the text).

Is there some way to do this?



Under KDE, there is the "Find Files/Folders" option on the main menu
that will do exactly this, or did you want something from the command line?


I don't use gnome, but I would expect it to have something similar.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:22 PM
Bowie Bailey
 
Default find

tony.chamberlain@lemko.com wrote:
> I am looking for something similar to the windows SEARCH FILES comman
> with the option "files containing ..." (that is where I can specify a
> string and it will find all files containing that string -- not just
> having the string as part of the name but actually containing it in
> the text).
>
> Is there some way to do this?

I tend to use a combination of 'find' and 'grep'. It looks something
like this:

find . -type f -name '*.txt' | xargs grep 'whatever'

Add the '-l' option to grep if you just want a list of the filenames.

--
Bowie
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:24 PM
"Akemi Yagi"
 
Default find

On Fri, Oct 3, 2008 at 6:54 AM, Bo Lynch <blynch@ameliaschools.com> wrote:
> On Fri, October 3, 2008 10:00 am, tony.chamberlain@lemko.com wrote:
>>
>> I am looking for something similar to the windows SEARCH FILES comman
>> with the option "files containing ..." (that is where I can specify a
>> string and it will find all files containing that string -- not just
>> having
>> the string as part of the name but actually containing it in the text).
>>
>> Is there some way to do this?
>
> I would recommend taking a look at grep. THere are many ways you can use it.

One such example is:

find . -type f -exec grep -il !* {} ; -exec grep -i !* {} ; -exec echo ;

alias it to, say, findword and run: findword <text>

It will show the file names as well as the lines that contain the text.

Akemi
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 02:27 PM
"Akemi Yagi"
 
Default find

On Fri, Oct 3, 2008 at 7:24 AM, Akemi Yagi <amyagi@gmail.com> wrote:
> On Fri, Oct 3, 2008 at 6:54 AM, Bo Lynch <blynch@ameliaschools.com> wrote:
>>
>> I would recommend taking a look at grep. THere are many ways you can use it.
>
> One such example is:
>
> find . -type f -exec grep -il !* {} ; -exec grep -i !* {} ; -exec echo ;
>
> alias it to, say, findword and run: findword <text>

Sorry, I missed the "!" in the above paste:

find . -type f -exec grep -il !* {} ; -exec grep -i !* {} ; -exec echo ;
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-03-2008, 03:01 PM
"William L. Maltby"
 
Default find

On Fri, 2008-10-03 at 16:04 +0200, Niki Kovacs wrote:
> tony.chamberlain@lemko.com a écrit :
> > I am looking for something similar to the windows SEARCH FILES comman
> > with the option "files containing ..." (that is where I can specify a
> > string and it will find all files containing that string -- not just having
> > the string as part of the name but actually containing it in the text).
> >
> > Is there some way to do this?
> >
> grep is your friend. Let's say you are looking for the character string
> 'UserDir' below your /etc directory. Then you would simply do:
>
> [root@grossebertha ~]# grep -R UserDir /etc/

If that might put out a lot and you want only a list of file names, add

-l or --files-with-matches

<snip>

--
Bill

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:48 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org