Re: Newby Question FC4

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

 



On Wed, 2006-01-18 at 12:08, chalonec wrote:
> I have installed FC4 and am looking for a command line way to search all 
> files in all directories and sub-directories on a disk for files that 
> contain a certain text string such as the word gateway or mode or any word. 
> There are so many config files on Linux that if I had this capability I 
> could find out which one had the information I needed so I could then begin 
> to identify where I might want to look to fix or troubleshoot something 
> other than the log files.  If this were Windows, I would just use the text 
> search string gui by right-clicking start.
>
> I have tried find, grep, locate, egrep, man, and the Internet and have had 
> varying levels of success but none seem to be consistent.  There are a 
> dizzying number of options,

grep -r string .
or
find . -type f -print |xargs grep string

> I am pretty sure grep or find should work but I can't figure out how.
> 
> Can someone help ?

Things that might help to know:
. is a convenient name for "current directory"
and
The shell will expand wildcards and process metacharacters on
the command line before apps see them, so if your search string
includes *?<>{}()|$&\"' (and I probably missed some), you should
enclose it in single quotes which the shell will remove. Add
-i to the grep command if you want case insensitivity.

-- 
  Les Mikesell
   lesmikesell@xxxxxxxxx



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux