Difference between revisions 507938 and 507939 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)
Example of search for "LOG" in jsmith's home directory
 find ~jsmith -exec grep "LOG" '{}' /dev/null \; -print
 /home/jsmith/scripts/errpt.sh:cp $LOG $FIXEDLOGNAME
 /home/jsmith/scripts/errpt.sh:cat $LOG
 /home/jsmith/scripts/title:USER=$LOGNAME

Example of search for the string "ERROR" in all 
xmlXML files in the current directory and all sub-directories
 find . -name "*.xml" -exec grep "ERROR" '{}' \; -print

The double quotes (" ") surrounding the search string and single quotes (<nowiki>' '</nowiki>) surrounding the braces are optional in this example, but needed to allow spaces and other special characters in the string.

===Search for all files owned by a user===
 find . -user <userid>

(contracted; show full)[[hu:Find]]
[[ja:Find]]
[[pl:Find]]
[[pt:Find]]
[[ro:Find]]
[[ru:Find]]
[[fi:Find (Unix)]]
[[uk:Find]]