Author Topic: Linux search  (Read 1503 times)

dbs

  • Newbie
  • *
  • Posts: 11
    • View Profile
Linux search
« 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

tkmedia

  • wants to work for LinuxMCE
  • **
  • Posts: 937
    • View Profile
    • LMCECompatible
Re: Linux search
« Reply #1 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
My Setup http://wiki.linuxmce.org/index.php/User:Tkmedia

For LinuxMce compatible  systems and accessories
http://lmcecompatible.com/

itsmeok

  • Veteran
  • ***
  • Posts: 100
    • View Profile
Re: Linux search
« Reply #2 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 *>

dbs

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Linux search
« Reply #3 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.

 


tkmedia

  • wants to work for LinuxMCE
  • **
  • Posts: 937
    • View Profile
    • LMCECompatible
Re: Linux search
« Reply #4 on: March 05, 2009, 04:41:25 pm »
My Setup http://wiki.linuxmce.org/index.php/User:Tkmedia

For LinuxMce compatible  systems and accessories
http://lmcecompatible.com/

zug

  • Veteran
  • ***
  • Posts: 60
    • View Profile
    • High Tech Pad
Re: Linux search
« Reply #5 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.
Z-Wave,  Peripherals, Licenced Media Directors and Cores now available with European-wide Delivery at www.hightechpad.com.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Linux search
« Reply #6 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!

dbs

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Linux search
« Reply #7 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

tkmedia

  • wants to work for LinuxMCE
  • **
  • Posts: 937
    • View Profile
    • LMCECompatible
Re: Linux search
« Reply #8 on: March 06, 2009, 06:47:00 pm »
man is your friend try man grep




My Setup http://wiki.linuxmce.org/index.php/User:Tkmedia

For LinuxMce compatible  systems and accessories
http://lmcecompatible.com/

dbs

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Linux search
« Reply #9 on: March 06, 2009, 07:38:45 pm »
man is your friend try man grep

Always nice to have a new best friend, thanks.

d