public final class Find extends Object
NAME
find - search for files in a directory hierarchy
SYNOPSIS
find <args> | |
find <path> | |
find <path> <name> | |
find <size> | |
find <path> <size> | |
find <size> <name> | |
find <path> <size> <name> | |
find [-dflxrinocamz] <name> | |
find [-dflxrinocamz] <path> <name> | |
find [-dflxrinocamz] <size> | |
find [-dflxrinocamz] <path> <size> | |
find [-dflxrinocamz] <time> | |
find [-dflxrinocamz] <path> <time> | |
find [-dflxrinocamz] <size> <name> | |
find [-dflxrinocamz] <path> <size> <name> | |
find [-dflxrinocamz] <time> <name> | |
find [-dflxrinocamz] <path> <time> <name> | |
find [-dflxrinocamz] <size> <time> <name> | |
find [-dflxrinocamz] <path> <size> <time> <name> |
See Find.Interface
for the corresponding command signature methods.
DESCRIPTION
Find searches the directory tree by evaluating different file matching expressions. The names of the matching files found in or below the working directory or the directories specified by the paths
operand are written to the standard output.
Options
The following options are supported:
-d | --typeDirectory | Consider only directories | |||
-f | --typeFile | Consider only regular files | |||
-l | --typeSymlink | Consider only symbolic links | |||
-x | --typeOther | Consider only files that are neither of directory (d), regular file (f) or symlink (l). | |||
-r | --regex | Use full regular expression syntax for the patterns specified by the
name operand
(This option is ignored if no name operand is specified). | |||
-i | --ignoreCase | Use case insensitive matching when applying the file name pattern
specified by the name operand
(This option is ignored if no name operand is specified). | |||
-n | --timeNewer | Consider only files that have been created, modified or accessed
after or at the time specified by the time operand (the default)
(This option is ignored if no time operand is specified). | |||
-o | --timeOlder | Consider only files that have been created, modified or accessed
before or at the time specified by the time operand
(This option is ignored if no time operand is specified). | |||
-c | --timeCreate | The time operand refers to the creation time of the file
(This option is ignored if no time operand is specified). | |||
-a | --timeAccess | The time operand refers to the last access time of the file
(This option is ignored if no time operand is specified). | |||
-m | --timeModified | The time operand refers to the last modification time of the file
(the default)
(This option is ignored if no time operand is specified). | |||
-z | --print0 | Print the full file name on the standard output, followed by a null character (instead of the newline character used by default). This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the --delimiter0 option of xargs. |
OPERANDS
The following operands are supported:
<path> | : | String | Starting point for the search in the directory hierarchy; wildcards * and ? are supported; relative paths are resolved on the basis of the current working directory. | ||
<name> | : | String | Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r) or
-iregex (-i) is specified. | ||
<size> | : | long | Consider only files using at least size bytes if size
is positive, or at most abs(size) bytes if size is zero
or negative. | ||
<time> | : | java.util.Date | Consider only files that have been created, modified or accessed
before or after the specified time operand; consider the
-time... options for details of the comparison. | ||
<args> | : | String... | String arguments defining the options and operands for the command. Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--path" operand have to be prefixed with the operand name (e.g. "--name" for subsequent path operand values). | ||
<options> | : | FindOptions | Options for the file search. |
Modifier and Type | Class and Description |
---|---|
static interface |
Find.Interface<R>
Interface defining all method signatures for the "find" command.
|
Modifier and Type | Field and Description |
---|---|
static FindFactory |
Factory
Singleton
factory instance for the "find" command. |
static String |
NAME
The "find" command name.
|
static FindOptionSets |
Options
|
public static final String NAME
public static final FindOptionSets Options
d
, f
, l
, x
, r
, i
, n
, o
, c
, a
, m
, z
.
-d | --typeDirectory | Consider only directories | |||
-f | --typeFile | Consider only regular files | |||
-l | --typeSymlink | Consider only symbolic links | |||
-x | --typeOther | Consider only files that are neither of directory (d), regular file (f) or symlink (l). | |||
-r | --regex | Use full regular expression syntax for the patterns specified by the
name operand
(This option is ignored if no name operand is specified). | |||
-i | --ignoreCase | Use case insensitive matching when applying the file name pattern
specified by the name operand
(This option is ignored if no name operand is specified). | |||
-n | --timeNewer | Consider only files that have been created, modified or accessed
after or at the time specified by the time operand (the default)
(This option is ignored if no time operand is specified). | |||
-o | --timeOlder | Consider only files that have been created, modified or accessed
before or at the time specified by the time operand
(This option is ignored if no time operand is specified). | |||
-c | --timeCreate | The time operand refers to the creation time of the file
(This option is ignored if no time operand is specified). | |||
-a | --timeAccess | The time operand refers to the last access time of the file
(This option is ignored if no time operand is specified). | |||
-m | --timeModified | The time operand refers to the last modification time of the file
(the default)
(This option is ignored if no time operand is specified). | |||
-z | --print0 | Print the full file name on the standard output, followed by a null character (instead of the newline character used by default). This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the --delimiter0 option of xargs. |
public static final FindFactory Factory
factory
instance for the "find" command.Copyright © 2024. All rights reserved.