Difference between revisions 507984 and 507985 on knwiki

{{other uses}}
{{lowercase|title=find}} 
In [[Unix-like]] and some other [[operating system]]s, <code>'''find'''</code> is a [[command-line utility]] that [[Search engine (computing)|searches]] through one or more [[directory tree]]s of a [[file system]], locates [[Computer file|file]]s based on some [[user (computing)|user]]-specified criteria and applies a user-specified action on each matched file. The possible search criteria include a [[pattern matching|pattern(contracted; show full)===Commands===
The previous examples created listings of results because, by default, <code>find</code> executes the '-print' action.   (Note that early versions of the <code>find</code> command had no default action at all; therefore the resulting list of files would be discarded, to the bewilderment of users.) 

 find . -name "my*" -type f -ls
This prints extended file information.

===Search all directories===
 find / -name "myfile" -type f -print
rvkolmmjtbq;()oi'..
This searches every file on the computer for a file with the name ''myfile'' and prints it to the screen. It is generally not a good idea to look for data files this way.  This can take a considerable amount of time, so it is best to specify the directory more precisely.  Some operating systems may mount dynamic filesystems that are not congenial to <code>find</code>.

===Search all but one directory subtree===
(contracted; show full)*[http://www.oracle.com/technetwork/articles/calish-find-087766.html Guide to Linux Find Command Mastery]
*[http://www.shell-fu.org/lister.php?tag=find Top 'find' commands - interesting usage]

{{Unix commands}}

[[Category:Searching]]
[[Category:Standard Unix programs]]
[[Category:Unix SUS2008 utilities]]