Difference between revisions 507941 and 507942 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) -name 'catalina.out' \) -size +300000k -a -size -5000000k`; do cat /dev/null > $file; done The units should be one of [bckw], 'b' means 512-byte blocks, 'c' means byte, 'k' means kilobytes and 'w' means 2-byte words. The size does not count indirect blocks, but it does count blocks in sparse files that are not actually allocated. ===Operators === Operators can be used to enhance the expressions of the find command. Operators are listed in order of decreasing precedence: *'''( expr )''' Force precedence. *'''! expr''' True if expr is false. *'''-not expr''' Same as ! expr. *'''expr1 expr2''' And (implied); expr2 is not evaluated if expr1 is false. *'''expr1 -a expr2''' Same as expr1 expr2. *'''expr1 -and expr2''' Same as expr1 expr2. *'''expr1 -o expr2''' Or; expr2 is not evaluated if expr1 is true. *'''expr1 -or expr2''' Same as expr1 -o expr2. *'''expr1 , expr2''' List; both expr1 and expr2 are always evaluated. The value of expr1 is discarded; the value of the list is the value of expr2. find . -name 'fileA_*' -or -name 'fileB_*' This command searches files whichose name has a prefix of "fileA_" or "fileB_" in the current directory. find . -name 'foo.cpp' -not -path '.svn' This command searches for files with the name "foo.cpp" in all subdirectories of the current directory (current directory itself included) other than ".svn". ==See also== *[[GNU locate]], a Unix search tool based on a prebuilt database therefore faster and less accurate than <code>find</code> *[[mdfind]], a similar utility that utilizes metadata for [[Mac OS X]] and [[Darwin (operating system)|Darwin]] *[[List of Unix programs]] *[[List of DOS commands]] *[[grep]] (contracted; show full)[[hu:Find]] [[ja:Find]] [[pl:Find]] [[pt:Find]] [[ro:Find]] [[ru:Find]] [[fi:Find (Unix)]] [[uk:Find]] All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://kn.wikipedia.org/w/index.php?diff=prev&oldid=507942.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|