{smcl} {* 22apr2009}{...} {hline} help for {hi:find} {hline} {title:Find specified text in multiple files} {title:Syntax} {p 6 16 2} {cmd:find} [{it:filenames}] [{cmd:,} {cmdab:m:atch(}{it:string}{cmd:)} {cmdab:s:how} {cmdab:z:ero} ] {marker description}{dlgtab:Description} {p}{cmd:find} looks for matching strings across multiple files in the current directory ({help pwd}). File names that contain an asterix are expanded into lists of files following {help dir}. If no files are specified, {cmd:find} looks for matching strings across all files in the current working directory (see also {help pwd} and {help cd}). Depending on your operating system, you may prefer {browse "http://en.wikipedia.org/wiki/Grep":grep} (*nix), {browse "http://technet.microsoft.com/en-us/library/bb490906.aspx":find} or {browse "http://technet.microsoft.com/en-us/library/bb490907.aspx":findstr} (Windows/DOS), or {browse "http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/mdfind.1.html":mdfind} (Mac).{p_end} {marker examples}{dlgtab:Examples} {p}Cut and paste the entire block of example code to the Command window, or click on commands one by one to run:{p_end} {p 6 16 2}{stata "cd `c(sysdir_base)'a": cd `c(sysdir_base)'a }{p_end} {p 6 16 2}{stata `"loc t : dir . file "*.ado""': loc t : dir . file "*.ado" }{p_end} {p 6 16 2}{stata "find `t', m(version 8) s": find `t', m(version 8) s }{p_end} {p 6 16 2}{stata "find, m(version 8)": find, m(version 8)}{p_end} {p 6 16 2}{stata "find *.class": find *.class }{p_end} {marker options}{dlgtab:Options summary} {phang} {cmdab:m:atch(}{it:string}{cmd:)} specifies the string to look for. {phang} {cmdab:s:how} asks for lines in which the string occurs to be echoed to the screen. Line numbers are also shown, and single quotes (ASCII codes 96 and 39) are converted into similar-looking but meaningless single quotes (ASCII codes 145 and 146, respectively). See also {help display} and {stata "help smcl, mark(ascii)":smcl}. {phang} {cmdab:z:ero} specifies that file names in the {it:filenames} list with zero matches should also be listed. {title:Author} Austin Nichols Urban Institute Washington, DC, USA {browse "mailto:austinnichols@gmail.com":austinnichols@gmail.com} {title:Also see} {p 1 10}On-line: help for {help type}, {help findfile}, {help file}, {help filefilter}, {help hexdump}, {help pwd}, {help cd}, {help dir}, etc. {p_end}