Symbian3/SDK/Source/GUID-215D2BD2-1757-5869-A589-98BE332EB4E2.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 15:24:34 +0100
changeset 9 59758314f811
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-215D2BD2-1757-5869-A589-98BE332EB4E2" xml:lang="en"><title>find</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p><userinput>find [-d | -s ] [pathname ...] expression</userinput> </p>
<p>The <codeph>find</codeph> command recursively descends the directory tree
for each pathname listed, evaluating an expression (composed of the <b>Primaries</b> and <b>Operands</b> listed
in the following sections) in terms of each file in the tree. </p>
<p>The <codeph>find</codeph> command supports the following options: </p>
<table id="GUID-B4D4105E-188A-51CB-A7AC-C88BCC474DD5">
<tgroup cols="2"><colspec colname="col0" colwidth="0.42*"/><colspec colname="col1" colwidth="1.58*"/>
<thead>
<row>
<entry><p><b>Option</b></p></entry>
<entry><p><b>Description</b></p></entry>
</row>
</thead>
<tbody>
<row>
<entry><p> <codeph>-d</codeph>  </p> </entry>
<entry><p>Cause <codeph>find</codeph> to perform a depth-first traversal,
that is directories are visited in post-order and all entries in a directory
will be acted on before the directory itself. By default, <codeph>find</codeph> visits
directories in pre-order, that is before their contents. </p> </entry>
</row>
<row>
<entry><p> <codeph>-s</codeph>  </p> </entry>
<entry><p>Cause <codeph>find</codeph> to traverse the file hierarchies in
lexicographical order, that is alphabetical order within each directory. </p> <p> <b>Notes:</b>  </p> <ul>
<li id="GUID-EC32CF84-4AA1-5803-9D9C-6E5DAB1B646D"><p>The <codeph>find -s</codeph> and <codeph>find
| sort</codeph> commands may give different results. </p> </li>
<li id="GUID-F90A1413-0E6D-5E8B-A999-30577E647E8E"><p>When the <codeph>-d</codeph> and <codeph>-s</codeph> options
are not used, the <codeph>find</codeph> command traverses the directory in
pre-order, that is the directories will be listed first followed by the files
in that directory. </p> </li>
</ul> </entry>
</row>
</tbody>
</tgroup>
</table>
<p> <b>Note:</b> For more information about using the <codeph>find</codeph> command,
search <xref href="http://www.freebsd.org/cgi/man.cgi" scope="external">http://www.freebsd.org/cgi/man.cgi</xref> by
specifying <codeph>find</codeph> as the search keyword and selecting the <b>FreeBSD
6.2-Release</b> option from the release list. </p>
<section><title>Primaries</title> <p>The following primaries are supported
by the <codeph>find</codeph> command: </p> <table id="GUID-57FEB8A9-6307-52C9-A151-11EA1AC43494">
<tgroup cols="2"><colspec colname="col0" colwidth="0.42*"/><colspec colname="col1" colwidth="1.58*"/>
<thead>
<row>
<entry><p><b>Primary</b></p></entry>
<entry><p><b>Description</b></p></entry>
</row>
</thead>
<tbody>
<row>
<entry><p> <codeph>-amin n</codeph>  </p> </entry>
<entry><p>True if the difference between the file last access time and the
time <codeph>find</codeph> was started, rounded up to the next full minute,
is <codeph>n</codeph> minutes. </p> </entry>
</row>
<row>
<entry><p> <codeph>-anewer file</codeph>  </p> </entry>
<entry><p>File was last accessed more recently than file was modified. </p> </entry>
</row>
<row>
<entry><p> <codeph>-atime n</codeph>  </p> </entry>
<entry><p>If no units are specified, this primary evaluates to true if the
difference between the file last access time and the time <codeph>find</codeph> was
started, rounded up to the next full 24-hour period, is <codeph>n</codeph> 24-hour
periods. </p> </entry>
</row>
<row>
<entry><p> <codeph>-cmin n</codeph>  </p> </entry>
<entry><p>True if the difference between the time of last change of file status
information and the time <codeph>find</codeph> was started, rounded up to
the next full minute, is <codeph>n</codeph> minutes. </p> </entry>
</row>
<row>
<entry><p> <codeph>-cnewer file</codeph>  </p> </entry>
<entry><p>True if the current file has been changed more recently than the
changed time of the file named by the pathname file. </p> </entry>
</row>
<row>
<entry><p> <codeph>-ctime n</codeph>  </p> </entry>
<entry><p>If no units are specified, this primary evaluates to true if the
difference between the time of last change of file status information and
the time <codeph>find</codeph> was started, rounded up to the next full 24-hour
period, is <codeph>n</codeph> 24-hour periods. </p> </entry>
</row>
<row>
<entry><p> <codeph>-delete</codeph>  </p> </entry>
<entry><p>Deletes the files specified as an argument to the <codeph>delete</codeph> option. </p> </entry>
</row>
<row>
<entry><p> <codeph>-depth </codeph>  </p> </entry>
<entry><p>Always true. This option is similar to the <codeph>-d</codeph> option. </p> </entry>
</row>
<row>
<entry><p> <codeph>-empty </codeph>  </p> </entry>
<entry><p>True if the current file or directory is empty. </p> </entry>
</row>
<row>
<entry><p> <codeph>-exec utility [argument ...] {} +</codeph>  </p> </entry>
<entry><p>The primary evaluates as true if the invoked utility returns a zero
value as exit status. </p> </entry>
</row>
<row>
<entry><p> <codeph>-iname pattern</codeph>  </p> </entry>
<entry><p>This option is similar to <codeph>-name</codeph>, but the match
is case insensitive. </p> </entry>
</row>
<row>
<entry><p> <codeph>-links n</codeph>  </p> </entry>
<entry><p>True if the file has <codeph>n</codeph> links. </p> </entry>
</row>
<row>
<entry><p> <codeph>-ls </codeph>  </p> </entry>
<entry><p>This primary always evaluates to true. The following information
for the current file is written to standard output; inode number, size in
512-byte blocks, file permissions, number of hard link, size in bytes, last
modification time, and pathname. </p> </entry>
</row>
<row>
<entry><p> <codeph>-maxdepth n</codeph>  </p> </entry>
<entry><p>Always true; descend at most <codeph>n</codeph> directory levels
below the command line arguments. If any <codeph>-maxdepth</codeph> primary
is specified, it applies to the entire expression even if it would not normally
be evaluated. <codeph>-maxdepth</codeph> 0 limits the whole search to the
command line arguments. </p> </entry>
</row>
<row>
<entry><p> <codeph>-mindepth n</codeph>  </p> </entry>
<entry><p>Always true; do not apply any tests or actions at levels less than <codeph>n</codeph>.
If any <codeph>-mindepth</codeph> primary is specified, it applies to the
entire expression even if it would not normally be evaluated. <codeph>-mindepth</codeph> 1
processes all but the command line arguments. </p> </entry>
</row>
<row>
<entry><p> <codeph>-mtime n</codeph>  </p> </entry>
<entry><p>If no units are specified, this primary evaluates to true if the
difference between the file last modification time and the time <codeph>find</codeph> was
started, rounded up to the next full 24-hour period, is <codeph>n</codeph> 24-hour
periods. </p> </entry>
</row>
<row>
<entry><p> <codeph>-name pattern</codeph>  </p> </entry>
<entry><p>True if the last component of the pathname being examined matches <codeph>pattern</codeph>.
Special shell pattern matching characters <b>[</b>, <b>]</b>, <b>*</b>, and <b>?</b> may
be used as part of <codeph>pattern</codeph>. These characters may be matched
explicitly by escaping them with a backslash (<b>\</b>). </p> </entry>
</row>
<row>
<entry><p> <codeph>-newer file</codeph>  </p> </entry>
<entry><p>True if the current file has a more recent last modification time
than <codeph>file</codeph>. </p> </entry>
</row>
<row>
<entry><p> <codeph>-path pattern</codeph>  </p> </entry>
<entry><p>True if the pathname being examined matches <codeph>pattern</codeph>.
Special shell pattern matching characters <b>[</b>, <b>]</b>, <b>*</b>, and <b>?</b> may
be used as part of <codeph>pattern</codeph>. These characters may be matched
explicitly by escaping them with a backslash (<b>\</b>). Slashes (<b>/</b>)
are treated as normal characters and do not have to be matched explicitly. </p> </entry>
</row>
<row>
<entry><p> <codeph>-print</codeph>  </p> </entry>
<entry><p>This primary always evaluates to true. It prints the pathname of
the current file to standard output. If none of <codeph>-exec</codeph>, <codeph>-ls</codeph>, <codeph>-print0</codeph>,
or <codeph>-ok</codeph> is specified, the given expression shall be effectively
replaced by <codeph>( given expression )           -print</codeph>. </p> </entry>
</row>
<row>
<entry><p> <codeph>-print0</codeph>  </p> </entry>
<entry><p>This primary always evaluates to true. It prints the pathname of
the current file to standard output, followed by an ASCII NUL character (character
code 0). </p> </entry>
</row>
<row>
<entry><p> <codeph>-printx</codeph>  </p> </entry>
<entry><p>This primary always evaluates to true. It prints the pathname of
the current file to standard output in a new line. </p> </entry>
</row>
<row>
<entry><p> <codeph>-prune </codeph>  </p> </entry>
<entry><p>This primary always evaluates to true. It causes <codeph>find</codeph> to
not descend into the current file. Note, the <codeph>-prune</codeph> primary
has no effect if the <codeph>-d</codeph> option was specified. </p> </entry>
</row>
<row>
<entry><p> <codeph>-size n[c]</codeph>  </p> </entry>
<entry><p>True if the file's size, rounded up, in 512-byte blocks is <codeph>n</codeph>.
If <codeph>n</codeph> is followed by a <codeph>c</codeph>, then the primary
is true if the file's size is <codeph>n</codeph> bytes (characters). </p> </entry>
</row>
<row>
<entry><p> <codeph>-type t</codeph>  </p> </entry>
<entry><p>True if the file is of the specified type. Possible file types are
as follows: </p> <ul>
<li id="GUID-97C7E16D-608B-51A7-AD08-4C241BAA39CB"><p> <b>b:</b> Block special </p> </li>
<li id="GUID-38CB8D36-3029-505E-BC8D-473DD9E11A7A"><p> <b>c:</b> Character
special </p> </li>
<li id="GUID-F9FC28B8-068E-5477-BA54-A9AC6C1D3EED"><p> <b>d:</b> Directory </p> </li>
<li id="GUID-555704A1-D975-59BF-8E66-730206EE2DE9"><p> <b>f:</b> Regular file </p> </li>
<li id="GUID-B884FFCD-714A-5F06-BE33-F6230B4E96C8"><p> <b>p:</b> FIFO </p> </li>
<li id="GUID-8A00A407-CD09-5958-B2B1-926C6F4660D4"><p> <b>s:</b> Socket </p> </li>
</ul> </entry>
</row>
</tbody>
</tgroup>
</table> <p>All primaries which take a numeric argument allow the number to
be preceded by a plus sign (<b>+</b>) or a minus sign (<b>-</b>). A preceding
plus sign means <b>more than n</b>, a preceding minus sign means <b>less than
n</b> and neither means <b>exactly n</b>. </p> <p> <b>Note:</b> The following
primaries are not supported by the Symbian version of the <codeph>find</codeph> command: </p> <ul>
<li id="GUID-805044AB-3DE8-5B8F-98D7-55FB2225EEBD"><p><codeph>-exec exe {}
\;</codeph> </p> </li>
<li id="GUID-0EDF9DA7-E700-5856-A435-9CE89599F08A"><p><codeph>-fstype</codeph> </p> </li>
<li id="GUID-13BE7836-F93B-591F-826B-B601B205F59D"><p><codeph>-group</codeph> </p> </li>
<li id="GUID-2E82D489-6421-55C7-8B03-C6B87D4923F1"><p><codeph>-inum</codeph> </p> </li>
<li id="GUID-29C2484B-E991-5872-AB04-FAD73815F178"><p><codeph>-iregex</codeph> </p> </li>
<li id="GUID-DA21023E-0ED4-5400-9DCD-53FEE6F8E35D"><p><codeph>-nouser</codeph> </p> </li>
<li id="GUID-E8A96727-BD43-5FEA-A298-2DD253A15A8D"><p><codeph>-nogroup</codeph> </p> </li>
<li id="GUID-1A8880CF-1F34-56B8-8F75-89CB27D9A51A"><p><codeph>-perm,</codeph> </p> </li>
<li id="GUID-189A601F-5065-5A0B-85B8-BC55CF34D5B3"><p><codeph>-user</codeph> </p> </li>
</ul> </section>
<section><title>Operators</title> <p>The primaries may be combined using the
following operators. The operators are listed in order of decreasing precedence. </p> <table id="GUID-FB435821-5475-50A3-8DA1-6A8457CFD3ED">
<tgroup cols="2"><colspec colname="col0" colwidth="0.49*"/><colspec colname="col1" colwidth="1.51*"/>
<thead>
<row>
<entry><p><b>Operator</b></p></entry>
<entry><p><b>Description</b></p></entry>
</row>
</thead>
<tbody>
<row>
<entry><p> <codeph>( expression ) </codeph>  </p> </entry>
<entry><p>This evaluates to true if the parenthesized expression evaluates
to true. </p> </entry>
</row>
<row>
<entry><p> <codeph>! expression</codeph>  </p> </entry>
<entry><p>This is the unary NOT operator. It evaluates to true if the expression
is false. </p> </entry>
</row>
<row>
<entry><p> <codeph>expression -and expression</codeph>  </p> </entry>
<entry><p>The <codeph>-and</codeph> operator is the logical AND operator.
As it is implied by the juxtaposition of two expressions it does not have
to be specified. The expression evaluates to true if both expressions are
true. The second expression is not evaluated if the first expression is false. </p> </entry>
</row>
<row>
<entry><p> <codeph>expression -or expression</codeph>  </p> </entry>
<entry><p>The <codeph>-or</codeph> operator is the logical OR operator. The
expression evaluates to true if either the first or the second expression
is true. The second expression is not evaluated if the first expression is
true. </p> </entry>
</row>
</tbody>
</tgroup>
</table> <p>All operands and primaries must be separate arguments to <codeph>find</codeph>.
Primaries which themselves take arguments expect each argument to be a separate
argument to <codeph>find</codeph>. </p> </section>
<section><title>Copyright notice</title> <p>For information about documentation
copyrights associated with the <codeph>find</codeph> command, see <xref href="http://www.freebsd.org/copyright/freebsd-doc-license.html" scope="external">http://www.freebsd.org/copyright/freebsd-doc-license.html</xref>. </p> <p><b>The
FreeBSD Documentation License</b> </p> <p>Copyright 1994-2006 The FreeBSD
Project. All rights reserved. </p> <p>Redistribution and use in source (SGML
DocBook) and 'compiled' forms (SGML, HTML, PDF, PostScript, RTF and so forth)
with or without modification, are permitted provided that the following conditions
are met: </p> <ol id="GUID-8477E6A8-CC08-5A9D-B03B-AE68C44FD987">
<li id="GUID-BD106442-7374-5E61-BDF8-8DBAB72BED55"><p>Redistributions of source
code (SGML DocBook) must retain the above copyright notice, this list of conditions
and the following disclaimer as the first lines of this file unmodified. </p> </li>
<li id="GUID-F49490B2-7096-5365-9245-33E83CAB1562"><p>Redistributions in compiled
form (transformed to other DTDs, converted to PDF, PostScript, RTF and other
formats) must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided
with the distribution. </p> </li>
</ol> <p>THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </p> </section>
</conbody></concept>