Newby Question FC4

Nix, Robert P. Nix.Robert at mayo.edu
Wed Jan 18 18:26:15 UTC 2006


-----Original Message-----
From: fedora-list-bounces at redhat.com [mailto:fedora-list-bounces at redhat.com] On Behalf Of chalonec
Sent: Wednesday, January 18, 2006 12:08 PM
To: For users of Fedora Core releases
Subject: Newby Question FC4

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. 
-----

What you're wanting can be granted by a *combination* of grep and find. (Ah! The beauty of Unix...)

If I want to search all the files on the system for the string "foo", I could do the following:

find / -type f -exec grep -l foo {} \;

Note that this might take a while, and it would be better to start with a subset already selected. i.e. If you're looking for config files specifically, do find /etc instead of find /.  


-- 
Robert P. Nix		Mayo Foundation
RO-OC-1-13		200 First Street SW
507-284-0844		Rochester, MN 55905
-----
"In theory, theory and practice are the same, but
 in practice, theory and practice are different."




More information about the fedora-list mailing list