Path: utzoo!attcan!uunet!tdatirv!pa1 From: pa1@tdatirv.UUCP (Pat Alvarado) Newsgroups: comp.unix.questions Subject: Re: grep Message-ID: <41@tdatirv.UUCP> Date: 25 Oct 90 15:09:53 GMT References: <1990Oct23.123025.18012@kodak.kodak.com> Reply-To: pa1@tdatirv.UUCP (Pat Alvarado) Organization: Teradata Corp., El Segundo, Ca. Lines: 22 In article <1990Oct23.123025.18012@kodak.kodak.com> tiefel@sunshine.Kodak.COM (Lenny Tiefel) writes: >I have a main directory with hundreds of subdirectories, >and I want to find a file with a particular string, say "xyz" >The grep command only works in one directory at a time. Is there >a way of searching my whole directory structure to find a file >with a particular string? Try: find . -type f -exec grep -l string {} \; This will tell find to start from the current directory (.) and with each file only (-type f) execute a grep with the -l option for your string. The grep -l option will only display the filename if the string was found. -- ||| Pat Alvarado | v Teradata Corporation | tdat!pa1@suntzu.sun.com /\ /\ 100 N. Sepulveda Blvd. | uunet!edsews!hacgate!tdat!pa1 /// \\\ El Segundo, Calif. 90245 | pa1@tdat.teradata.com