LinuxMCE Forums

General => Users => Topic started by: dbs on March 05, 2009, 06:49:22 AM

Title: Linux search
Post by: dbs on March 05, 2009, 06:49:22 AM
I'm impressed. This is a magnificent undertaking. I look forward to being a part of it, however small. I've been married to computers since the mid seventies, but never used linux. Always interested and cheering from the sidelines, but knowing if I started, it would be one more major time-eater. LinuxMCE pushes all my buttons, so here I am.

In browsing the posts, I keep running into instances where no one (at least of those who reply) has any idea where some settings are kept. One of the most common seems to be file and directory paths. I'm certain that somewhere out there in linuxland there's a search utility that would allow me to key in the offending string and let me know in which files it can be found.

Thanks again to all those who've worked on this project, it's one of my daydreams come to life.

d
Title: Re: Linux search
Post by: tkmedia on March 05, 2009, 07:16:41 AM
not sure why you need that .... but start learning some linux basics..


two useful commands are locate and grep
ask google about them

HTH

Tim
Title: Re: Linux search
Post by: itsmeok on March 05, 2009, 08:20:02 AM
Not sure about the settings but if you would look for a file I have the following to share that I always use.

sudo find / -name <filename or part of it with *>
Title: Re: Linux search
Post by: dbs on March 05, 2009, 08:48:54 AM
Thanks for the replies

In the case I mentioned, files were being directed to the wrong folder. The individuals couldn't seem to find where the configuration file was located.

The search tool I was inquiring about would entail a global (or directed) search that included nested subdirectories and allow filtering to determine the files scanned, ie  *.ext  or file.* or the all inclusive *.*

It would then search for the requested string and display the line of text in which the match was found along with the path and filename of the file.

In this example, a search for the misguided path string would bring possible culprits up in the hits.

It's a pretty basic utility, I'm sure linux has one.



Title: Re: Linux search
Post by: tkmedia on March 05, 2009, 04:41:25 PM
A quick google of grep yields ;)

http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_04_02.html


Title: Re: Linux search
Post by: zug on March 05, 2009, 08:09:53 PM
If you need to know about a command, or just find a command to do something you need, a good place to look is www.commandlinefu.com. You can use the search command and often you will find a command and an example of how to use it. It is incredibly handy.
Title: Re: Linux search
Post by: colinjones on March 05, 2009, 10:44:11 PM
dbs - the commands you seek have already been mentioned here :)

I often use the 'find' construct that itsmeok mentions to find a filename containing a specific piece of text. The (s)locate command Tim mentions is an alternative as well and for content. And the grep command is a very easy way of doing it real time without having to build a database....

I'm really not sure which threads you are looking at.... I imagine there is some other issue at hand, as none of these methods above are in any way obscure, people use them all the time!
Title: Re: Linux search
Post by: dbs on March 06, 2009, 06:29:29 PM
Thanks colinjones and other responders. In my initial search on grep all I kept finding were simple examples with no mention of command line options/syntax. grep -r  ...got it. 

d
Title: Re: Linux search
Post by: tkmedia on March 06, 2009, 06:47:00 PM
man is your friend try man grep




Title: Re: Linux search
Post by: dbs on March 06, 2009, 07:38:45 PM
Quote from: tkmedia on March 06, 2009, 06:47:00 PM
man is your friend try man grep

Always nice to have a new best friend, thanks.

d