Difference between revisions 507937 and 507938 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)
This uses [[Perl]] to build the above command for you:

 echo "'MyFile*'" |perl -pe 's/([a-zA-Z])/[\L\1\U\1]/g;s/(.*)/find . -name \1/'|sh

===Search files by size===
Example of searching files with size between 100 kilobytes and 500 kilobytes.
 find . -size +100k -a -size -500k

Example of searching empty files.
 find . -size 0k
Example of searching non-empty files.
 find . ! -size 0k

===Search files by name and size ===
 find /usr/src -not \( -name "*,v" -o -name ".*,v" \) '{}' \; -print 

This command will search in the /usr/src directory and all sub directories. All files that are of the form '*,v' and '.*,v' are excluded. Important arguments to note are:
    -not means the negation of the expression that follows
    \( means the start of a complex expression.
(contracted; show full)[[hu:Find]]
[[ja:Find]]
[[pl:Find]]
[[pt:Find]]
[[ro:Find]]
[[ru:Find]]
[[fi:Find (Unix)]]
[[uk:Find]]