sfind - Searches for files in a directory hierarchy
sfind
[path …]
[expression]
SUNWqfs
SUNWsamfs
The sfind (1) command contains Oracle extensions to the
GNU find (1) command. The extensions support the features
of files that reside in StorageTek QFS or Oracle HSM file systems.
The sfind command
searches the directory tree rooted at each path by
evaluating the specified expression from left to right,
according to the rules of precedence.
The search continues until the outcome is
known (the left hand side is false for and operations, true for
or), at which point the sfind command moves on to
the next file name.
For more information on the rules
of precedence, see the OPERATORS
section of this man page.
The Oracle extensions to this command include the addition of several tests that reference characteristics specific to files that reside in a StorageTek QFS or Oracle HSM file system. These tests are as follows:
-admin_id n,
-any_copy_archive_i,
-any_copy_d,
-any_copy_r,
-any_copy_s,
-any_copy_u,
-any_copy_v,
-archdone,
-archive_C,
-archive_d,
-archive_I,
-archive_n,
-archived,
-archpos n,
-archpos1 n,
-archpos2 n,
-archpos3 n,
-archpos4 n,
-copies n,
-copy n,
-copy_archive_i n,
-copy_d n,
-copy_r n,
-copy_s n,
-copy_u n,
-copy_v n,
-damaged,
-is_setfa_D,
-is_setfa_g,
-is_setfa_s,
-mt media_type,
-mt1 media_type,
-mt2 media_type,
-mt3 media_type,
-mt4 media_type,
-offline,
-online,
-ovfl,
-ovfl1,
-ovfl2,
-ovfl3,
-ovfl4,
-partial_on,
-project pname,
-release_a,
-release_d,
-release_n,
-release_p,
-rmedia,
-rmin n,
-rtime n,
-sections n,
-sections1 n,
-sections2 n,
-sections3 n,
-sections4 n,
-segment n,
-segment_a,
-segment_i,
-segment_s,
-segmented,
-segments n,
-setfa_g n,
-setfa_s n,
-ssum_algo n,
-ssum_F,
-ssum_g,
-ssum_u,
-ssum_v,
-stage_a,
-stage_d,
-stage_n,
-verify,
-vsn pattern,
-vsn1 pattern,
-vsn2 pattern,
-vsn3 pattern,
-vsn4 pattern,
-xmin n,
-xtime n.
For a comprehensive lists of tests, see the TESTS section of this man page.
This command accepts the following options:
Specifies the path to the directory to be searched.
If no path is specified, the sfind command searches the
current directory.
If a path is specified, the path must appear on the command
line to the left of the expression argument.
If specifying more than one path,
separate each with a space character.
An expression composed from arguments described in the
OPTIONS, TESTS, ACTIONS, and OPERATORS
sections of this man page.
If no expression is specified, -print is used.
The expression must begin with one of the following characters:
- A dash (-) - An opening parenthesis (() - A closing parenthesis ()) - A comma (,) - An exclamation point (!)
Any arguments to the left of the preceding character list are assumed to be paths to search. Any arguments to the right of the preceding character list are assumed to be part of the expression.
An expression can be constructed from the following:
Options, which affect overall operation rather than the processing of a specific file. Options always return true. For a list of possible options, see the OPTIONS section.
Tests, which return a true or false value. For a list of possible tests, see the TESTS section.
Actions, which have side effects. Actions return a true or false value.
If expression contains no actions other than -prune,
the -print action is performed on all files
for which the expression is true.
For a list of possible actions, see the ACTIONS section.
Operators, which separate options, tests, and actions.
For a list of possible operators, see the OPERATORS section.
The -and operator is assumed if no operator is specified.
An expression can contain one or more options. The options always return true. The available options are as follows:
Action
-daystartMeasures times for -amin,
-atime,
-cmin,
-ctime,
-mmin,
and
-mtime
from the beginning of today rather than from 24 hours ago.
-depthProcesses each directory's contents before the directory itself.
-followDereferences symbolic links. Implies the -noleaf
option. For more information, see the -noleaf information
that follows in this list.
-maxdepth levelsDescends at most levels
levels of
directories below the command line arguments.
The levels argument muse be a nonnegative integer.
If you specify -maxdepth 0, the tests
and actions are applied to
the command line arguments only.
For more information, see the TESTS
and ACTIONS sections of this man page.
-mindepth levelsPrevents any tests or actions from being performed at
levels less than levels.
The levels argument must be a nonnegative integer.
If you specify -mindepth 1, all files except
the command line arguments are processed.
For more information, see the TESTS
and ACTIONS sections of this man page.
-noleafSupresses optimization. When specified, the command does not assume that directories contain 2 fewer subdirectories than their hard link count. This option is needed when searching file systems that do not follow the UNIX directory-link convention. Such file systems include CD-ROM or MS-DOS file systems or AFS volume mount points.
Each directory on a typical UNIX file system has at least 2
hard links: its name and its . entry. If subdirectories
are present, each of those has a .. entry linked to that
directory. When the sfind command
examines a directory, after it has statted 2 fewer subdirectories
than the directory's link count, it assumes that the rest of the entries
in the directory are not directories. That is, the rest of the entries
are leaf files in the directory
tree. If only the files' names need to be examined, there is no need
to stat them; this gives a significant increase in search speed.
-test_segmentsFor a segmented file, applies sfind tests to each individual
data segment and to the index inode. If a sfind test returns
true for a data segment or for a segmented file's index
inode, sfind writes the file path, a slash, and the segment number.
The number zero is written for the index inode's segment number.
The following options always automatically enable
the -test_segments option: -segment n,
-segment_i, -segment_s.
If this option is not specified, and the tests are applied to a segmented file, then the tests are applied at the file-level, and they are aggregated over all data segments.
This option has no effect on test results when applied to unsegmented files.
For more information, see the TESTS section of this man page.
-versionWrites the sfind command's version number to standard error.
-ractiveIf the WORM feature is active writes the path of files which are retained and the retention period has not expired.
-roverIf the WORM feature is active writes the path of files whose retention period has expired.
-rafter dateIf the WORM feature is active writes the path of files whose retention period ends after the given date. The date is specified with traditional format CCYYMMDDHHMM. CC is the century, YY is the year, MM is the month, DD is the day, HH is the hour, and MM is minute(s).
-rremain timeIf the WORM feature is active writes the path of files with retention periods with at least time left. The time is a duration specified as a combination of years, days, hours, and minutes given as a string "MyNdOhPm" where M, N, O, P are arbitrary non-negative integers. y, d, h, m represent the number of years, days, hours, and minute(s) for the search.
-rlonger timeIf the WORM feature is active writes the path of files with retention periods longer than time. The time is a duration specified as a combination of years, days, hours, and minutes given as a string "MyNdOhPm" where M, N, O, P are arbitrary non-negative integers. y, d, h, m represent the number of years, days, hours, and minute(s) for the search.
-rpermanentIf the WORM feature is active writes the path of files whose retention period is permanent.
-xdevPrevents the command from descending directories on other file systems.
An expression can contain one or more tests.
Many tests accept a numeric argument, n. The numeric
arguments can be specified with a preceding plus sign (+) or
minus sign (-), as follows:
FormatMeaning
+nGreater than n.
-nLess than n.
Exactly n.
The available tests are as follows:
Condition
-admin_id nFile has admin id number n.
-amin nFile was last accessed n minutes ago.
-anewer fileFile was last accessed more recently than file was modified.
The -anewer test affects the -follow option only
if the -follow option comes before (is to the left of)
the -anewer test on the command line.
-any_copy_archive_iFile's copy is marked to be archived immediately.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the segmented file's index inode's
copy is marked to be archived immediately or one of the file's data
segment's copy is marked to be archived immediately.
-any_copy_dFile has an archive copy that is damaged.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the segmented file's index inode has
an archive copy that is damaged or if at least one of the file's data
segments has an archive copy that is damaged.
-any_copy_rFile has an archive copy marked for rearchiving by
the rearch (1m) command or by the recycler.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the segmented file's index inode has an
archive copy marked for rearchiving or if at least one of the file's
data segments has an archive copy marked for rearchiving.
-any_copy_sFile has an archive copy that is stale.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the segmented file's index inode has
an archive copy that is stale or if at least one of the file's data
segments has an archive copy that is stale.
-any_copy_uFile has an unarchived copy.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the segmented file's index inode has
an unarchived copy or if at least one of the file's data
segments has an unarchived copy.
-any_copy_vFile has an archive copy that is verified.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the segmented file's index inode has
an archive copy that is verified or if all of the file's data
segments have an archive copy that is verified.
-archdoneFile has completed archive processing. The archiver has no further work to do on the file at this time. Note that this does not mean that the file has been archived.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true for a segmented file if and
only if all of the file's data segments have completed archive
processing. This test does not evaluate a segmented file's index
inode to see if it has completed archive processing.
-archive_CFile has had the equivalent of archive -C run against it,
so the concurrent archiving is enabled.
For more information
on the -C option to the archive (1) command,
see the archive (1) man page.
-archive_dFile has had the equivalent of archive -d run against it,
so the archiver handles it according to system defaults.
For more information
on the -d option to the archive (1) command,
see the archive (1) man page.
-archive_IFile has had the equivalent of archive -I run against it,
so the inconsistent archiving is supported.
For more information
on the -I option to the archive (1) command,
see the archive (1) man page.
-archive_nFile has had the equivalent of archive -n run against it,
so it will never be archived.
For more information
on the -n option to the archive (1) command,
see the archive (1) man page.
-archivedFile is archived.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if all of the file's data
segments are archived. This test does not evaluate a segmented file's
index inode to see if it has been archived. The following sfind command
finds files on ∕sam6 whose index inode has been archived:
sfind ∕sam6 -archived -segment_i -print
The preceeding sfind command identifies only index inodes that have
been archived; it does not yield any information regarding whether a segmented
file's data segments have been archived.
-archpos nFile has at least one archive copy at position n.
Note that n may be preceded by + or -, and specified
in decimal, or hexadecimal if preceded by "0x". This position
is the position prior to the decimal point in sls output
or the archiver log. If n is a path starting with "d" or "f"
it is interpreted as a relative path to a disk archive file.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the file's index inode has at
least one archive copy at position n or if at least one of the
file's data segments has at least one archive copy at position n.
-archpos1 n | -archpos2 n | -archpos3 n | -archpos4 nFile has the indicated copy number (1-4) at position n.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the file's index inode has the
indicated archive copy at position n or if at least one of the
file's data segments has the indicated archive copy at position n.
-atime nFile was last accessed n*24 hours ago.
-cmin nFile status was last changed n minutes ago.
-cnewer fileFile status was last changed more recently than file
was modified. The -cnewer test is affected by
the -follow option only if the -follow option comes
before (is to the left of) the -cnewer test on the
command line.
-copies nFile has n archive copies.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if each of the file's data
segments have n archive copies. This test does not evaluate a segmented
file's index inode to see if it has n archive copies.
-copy nFile has an archive copy number n.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if each of the file's data
segments have an archive copy number n. This test does not evaluate a
segmented file's index inode to see if it has an archive copy number n.
-copy_archive_i nFile's copy n is marked to be archived immediately.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the segmented file's index inode's copy n is
marked to be archived immediately or if at least one of the
file's data segment's copy n is marked to be archived immediately.
-copy_d nFile has an archive copy number n that is damaged.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the segmented file's index inode has
an archive copy number n that is damaged or if at least one of the
file's data segments has an archive copy number n that is damaged.
-copy_r nFile has an archive copy number n marked for rearchiving
by the rearch (1m) command or by the recycler.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the segmented file's index inode has
an archive copy number n marked for rearchiving or if at least one of the
file's data segments has an archive copy number n marked for rearchiving.
-copy_s nFile has a stale archive copy number n.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the segmented file's index inode has
a stale archive copy number n or if at least one of the
file's data segment has a stale archive copy number n.
-copy_u nFile's archive copy number n is unarchived by the unarchive (1m)
command.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the segmented file's index inode's
archive copy number n is unarchived or if at least one of the
file's data segment's archive copy number n is unarchived.
-copy_v nFile has an archive copy number n that is verified.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the segmented file's index inode has
an archive copy number n that is verified or if all of the
file's data segments have an archive copy number n that is verified.
-ctime nFile status was last changed n*24 hours ago.
-damagedFile is damaged.
-emptyFile is empty and is either a regular file or a directory.
-falseAlways false.
-fstype typeFile is on a file system of type type.
Possible file system types differ among the different UNIX versions
and include, but are not limited to, the
following: ufs, 4.2, 4.3, nfs, tmp,
mfs, S51K, and S52K.
You can use the -printf action with its %F argument
to obtain the types of your file systems.
For more information on -printf, see the ACTIONS section.
-gid nFile has n for its numeric group ID.
-group gnameFile belongs to group gname. A numeric group ID is allowed.
-ilname patternLike -lname, but the match is case insensitive.
-iname patternLike -name, but the match is case insensitive.
For example, a pattern of fo* and F?? both
match file names Foo, FOO, foo, fOo, and so on.
-inum nFile has inode number n.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if any of the file's data segments
or its index inode have inode number n.
-ipath patternLike -path, but the match is case insensitive.
-iregex patternLike -regex, but the match is case insensitive.
-is_setfa_DFile has had its directio set using the setfa -D
command. For more information on the setfa -D command,
see the setfa (1) man page.
-is_setfa_gFile has had its stripe group number set using the setfa -g
command. For more information on the setfa -g command,
see the setfa (1) man page.
-is_setfa_sFile has had its stripe width set using the setfa -s
command. For more information on the setfa -s command,
see the setfa (1) man page.
-links nFile has n links.
-lname patternFile is a symbolic link whose contents match shell pattern
pattern.
The metacharacters do not treat the slash character (∕) or the
period character (.) specially.
-mmin nFile's data was last modified n minutes ago.
-mt media_typeFile has an archive copy on the specified media_type on any copy.
-mt1 media_type | -mt2 media_type | -mt3 media_type | -mt4 media_typeFile has an archive copy on the specified media_type for the indicated copy number (1-4).
-mtime nFile's data was last modified n*24 hours ago.
-name patternBase of file name (the path with the leading directories removed)
matches shell pattern pattern. The metacharacters
(*, ?, and [ ]) do not match a . at the
start of the base name. To ignore
a directory and the files under it, use the -prune action.
For more information, see the example in the -path test
in this list.
-newer fileFile was modified more recently than file.
The -follow option
affects the -newer test
only if the -follow option comes before (is to the left of)
the -newer test on the command line.
-nouserNo user corresponds to the file's numeric user ID.
-nogroupNo group corresponds to the file's numeric group ID.
-offlineFile is offline.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the file's index inode is offline
or if all of the file's data segments are offline.
-onlineFile is online.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the file's index inode is online
and all of the file's data segments are online.
-ovflFile has at least one archive copy that has sections on more than one VSN; this condition is known as volume overflow.
For a segmented file, if the -test_segments option is not in effect,
this test evaluates to true if the file's index inode has at least
one archive copy that has sections on more than one VSN or if
at least one of the file's data segments has an archive copy that has
sections on more than one VSN.
-ovfl1 | -ovfl2 | -ovfl3 | -ovfl4File has an archive copy that has sections on more than one VSN for the indicated copy number (1-4).
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the file's index inode has an
archive copy that has sections on more than one VSN for the indicated
copy number or if at least one of the file's data segments has an archive
copy that has sections on more than one VSN for the indicated copy number.
-partial_onFile has the partial-release attribute set and the partially retained portion of the file is online.
-path patternFile name matches shell pattern pattern.
The metacharacters do not treat the slash (∕) or
the period (.) specially. For example,
the following line writes an entry for a directory
called .∕src∕misc (if one exists):
sfind. -path '.∕sr*sc'
To ignore a whole directory tree, use the -prune action
rather than
checking every file in the tree. For example, the following
command skips the
directory src∕emacs for all files and directories under it and
it writes the names of the other files found:
sfind. -path '.∕src∕emacs' -prune -o -print
-perm modeFile's permission bits are exactly mode (octal or symbolic). Symbolic modes use mode 0 as a point of departure.
-perm -modeAll of the permission bits mode are set for the file.
-perm +modeAny of the permission bits mode are set for the file.
-project pnameFile belongs to project pname. A numeric project ID is allowed.
-regex patternFile name matches regular expression pattern.
This is a match on the whole path, not a search.
For example, to match a file named .∕fubar3,
you can use the regular expression .*bar. or .*b.*3,
but not b.*r3.
-release_dFile has had the equivalent of having the release (1) command
with its -d option run against it,
and thus has the default release handling.
-release_aFile has had the equivalent of having the release (1) command
with its -a option run against it,
and thus will be released immediately after being archived.
-release_nFile has had the equivalent of having the release (1) command
with its -n option run against it,
and thus will never be released.
-release_pFile has had the equivalent of having the release (1) command
with its -p option run against it,
and thus will be partially released.
-rmediaFile is a removable media file.
-rmin nFile's residence was changed n minutes ago.
-rtime nFile's residence was changed n*24 hours ago.
-sections nFile has at least one archive copy that has sections on n VSNs.
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the file's index inode has at least
one archive copy that has sections on n VSNs or if at least one of
the file's data segments has an archive copy number n that has
sections on n VSNs.
-sections1 n | -sections2 n | -sections3 n | -sections4 nFile has an archive copy that has sections on n VSNs for the indicated copy number (1-4).
For a segmented file, if the -test_segments option is not in
effect, this test evaluates to true if the file's index inode has at
least one archive copy that has sections on n VSNs for the
indicated copy number or if at least one of the file's data segments has an
archive copy number n that has sections on n VSNs.
-segment nData segment or index inode has segment number n.
Index inodes always have segment number 0. Data segments are numbered sequentially starting with 1.
This test always causes sfind to run as if the -test_segments
option were in effect.
-segment_aFile or directory has had the segment attribute set.
If the -test_segments option is also in effect, then this test
evaluates to true for index inodes and data segments in addition to files and
directories that have had the segment attribute set.
-segment_iItem is an index inode.
This test always causes sfind to run as if the
-test_segments option were in effect.
-segment_sItem is a data segment.
This test always causes sfind to run as if the
-test_segments option were in effect.
-segmentedItem is a segmented file.
If used in conjunction with the -test_segments option, this test
evaluates to true for index inodes and data segments.
-segments nSegmented file has n data segments.
-setfa_g nFile's stripe group was set to n using
the command setfa -g n.
For more information on the setfa -g command,
see the setfa (1) man page.
-setfa_s nFile's stripe width was set to n using
the command setfa -s n.
For more information on the setfa -s command,
see the setfa (1) man page.
-size n[unit]File uses n 512-byte blocks. To specify another size, use the unit suffix. The possible unit specifiers are as follows:
Meaning
b or cBytes.
kKilobytes.
mMegabytes.
gGigabytes.
tTerabytes.
For example, the following specifications are equivalent:
-size 3 -size 1536b
The -size test does not count indirect blocks,
but it does count blocks in sparse files that are not actually allocated.
-ssum_algo n,File has checksum algorithm n.
-ssum_FFile has had the equivalent of the ssum (1) command with
its -F option run against it, and thus will be marked
immutable and have the gen and use attributes set.
The file's message digest is checked then the file is archived
and verified (used) when it is staged.
-ssum_gFile has had the equivalent of the ssum (1) command with
its -g option run against it, and thus will
have a checksum value generated and stored for it when it is archived.
-ssum_uFile has had the equivalent of the ssum (1) command with
its -u option run against it, and thus will
have a checksum value verified (used) when it is staged.
-ssum_vFile has a valid checksum value.
For a segmented file, if the -test_segments option is not
in effect, this test evaluates to true if all of the file's data
segments have valid checksum values. This test does not evaluate a
segmented file's index inode to see if it has a valid checksum value.
-stage_aFile has had the equivalent of the stage (1) command with
its -a option run against it, and thus will
have associative staging behavior.
-stage_dFile has had the equivalent of the stage (1) command with
its -d option run against it, and thus will
have the default staging behavior.
-stage_nFile has had the equivalent of the stage (1) command with
its -n option run against it, and thus will
not be staged into disk cache for read references.
-trueAlways true.
-type cFile is of type c. For c, specify one of the following:
Type cMeaning
bBlock (buffered) special.
cCharacter (unbuffered) special.
dDirectory.
pNamed pipe (FIFO).
fRegular file.
lSymbolic link.
sSocket.
RRemovable media file.
-uid nFile's numeric user ID is n.
-used nFile was last accessed n days after its status was last changed.
-user unameFile is owned by user uname (numeric user ID allowed).
-verifyFile has the verify attribute set.
See the ssum (1) man page for more information on the verify
attribute.
-vsn patternFile has an archive copy on a volume with VSN matching shell pattern pattern for any copy.
-vsn1 pattern | -vsn2 pattern | -vsn3 pattern | -vsn4 patternFile has an archive copy on a volume with VSN matching shell pattern pattern for the indicated copy (1-4).
-xmin nFile's data was created n minutes ago.
-xtime nFile's data was created n*24 hours ago.
-xtype cThe same as -type unless the file is a symbolic link.
For symbolic links, the -xtype test checks the type of
the file that the -type test does not check.
For c values, see the -type test in this list.
For symbolic links, the following occurs:
If the -follow option has not been specified,
the test returns true if the file is a link to a file of type c.
If the -follow option has been specified,
the test returns true if c is l.
An expression can contain one or more actions. The available actions are as follows:
Result
-exec command ;Executes the specified command.
True if 0 status is returned.
All arguments to the right of the -exec
keyword are assumed to be arguments to command
until an argument consisting of a semicolon (;) is encountered.
The string {} is replaced by the current
file name being processed everywhere it occurs in the arguments to the
command, not just in arguments where it is alone, as in some versions
of the find (1) command.
Both of these constructions might need to be escaped with a
backslash character (\fB\) or quoted to protect them from expansion
by the shell.
-fprint fileTrue. Writes the full file name to file file.
If file does not exist when sfind is run, it is created.
If file does exist, it is truncated.
The file names ∕dev∕stdout and ∕dev∕stderr are
handled specially; they refer to the standard
output and standard error output, respectively.
-fprint0 fileTrue. Similar to the -print0 action,
but it writes to file like -fprint.
-fprintf file formatTrue. Similar to the -printf action,
but it writes to file, using format,
like the -fprint action. For information on
possible format option, see
the -printf format action.
-ok command ;Executes the specified command, like the -exec action,
but it asks the user first (on the standard input).
If the user response
does not start with y or Y, command is not run, and
the return value is false.
-printTrue. Writes the full file name, followed by a newline, to standard output.
-print0True. Writes the full file name, followed by a null character,
to standard output. This allows file names that contain newlines to be
interpreted correctly by programs that process the sfind output.
-printf formatTrue. Writes format to standard output, interpreting
both backslash (\fB\) escape and percent character (%)
directives. Field widths and precisions can be
specified as with the printf (3C) C library function.
Unlike the -print action, the -printf action
does not add a newline at the end of the string.
Two lists follow. The escapes are listed first, and the directives are listed after the escapes.
EscResult
Alarm bell.
Backspace.
Stops printing from this format immediately.
Form feed.
Newline.
Carriage return.
Horizontal tab.
Vertical tab.
A literal backslash (\fB\).
A backslash character (\fB\) followed by any other character is treated as an ordinary character, so both are written.
The directives begin with a percent (%) character
followed by another character from the following list. If
the % character is followed by a character that is not from this
list,
the directive is discarded, but the other character is printed.
The directives are as follows:
DirMeaning
%%A literal percent sign.
%aFile's last access time in the format returned by
the C ctime (3C) function.
%AkFile's last access time in the format specified
by k, which is either an ampersand (@)
or a directive for the C strftime (3C) function.
The directives specify either the time or date.
The possible
values for k follow. Some of them might not be
available on all systems, due to differences in the strftime (3C)
function between systems.
An ampersand (@). The ampersand signifies
seconds elapsed since Jan. 1, 1970, 00:00 GMT.
A time field. The time fields are as follows:
Meaning
HThe hour in 00, …, 23 format.
IThe hour in 01, …, 12 format.
kThe hour in 0, …, 23 format.
lThe hour in 1, …, 12 format.
MThe minute in 00, …, 59 format.
pSpecifies whether the locale's time is AM or PM.
rThe time in a 12-hour format. This results in
a hh:mm:ss [A | P]M format.
SThe second in a 00, …, 61 format.
TThe time in a 24-hour format. This results in
a hh:mm:ss format.
XThe locale's time representation in H:M:S.
ZThe time zone (for example, EDT) or nothing (if no
time zone is determinable).
A date field. The date fields are as follows:
Meaning
aThe locale's abbreviated weekday name in, …, Sat format.
AThe locale's full weekday name, in day, …, Saturday format. This is of variable length.
b, hThe locale's abbreviated month name in Jan, …, Dec format.
BThe locale's full-month name in January, …, December format. This is of variable length.
cThe locale's date and time in the following example format: Sat Nov 04 12:02:33 EST 1989.
dThe day of month in 01, …, 31 format.
DThe date in mm∕dd∕yy format.
jThe day of year in 001, …, 366 format.
mThe month in 01, …, 12 format.
UThe number of the week in the year, with day considered to be the first day of week, in 00, …, 53 format.
wThe day of week in 0, …, 6 format.
WThe number of the week in the year, with Monday considered to be the first day of week, in 00, …, 53 format.
xThe locale's date representation in mm∕dd∕yy format.
yThe last two digits of year in 00, …, 99 format.
YThe year in the following example format: 2002.
DirMeaning
%bFile's size in 512-byte blocks (rounded up).
%BFile's start time for the WORM retention period in the format
returned by the C ctime (3C) function.
A dash (-) is written if the item is not a WORM, or does not reside
in a QFS or Oracle HSM file system.
%cFile's last status change time in the format returned by
the C ctime (3C) function.
%CkFile's last status change time in the format specified by k,
which is the same as for the %Ak directive.
For more information,
see the %Ak directive previously in this list.
%dFile's depth in the directory tree. A zero (0) means that the file is a command line argument.
%eFile's creation time in the format returned by
the C ctime (3C) function.
A dash (-) is written if the item does not reside in a QFS or Oracle HSM file system.
%EkFile's creation time in the format specified by k,
which is the same as for %Ak.
For more information,
see the %Ak directive previously in this list.
A dash (-) is written if the item does not reside in a QFS or Oracle HSM file system.
%fFile's name with any leading directories removed.
%FType of file system the file is on.
This value can be used for the -fstype test.
%gFile's group name. This is the numeric group ID if the group has no name.
%GFile's numeric group ID.
%hLeading directories of file's name.
%HCommand line argument under which file was found.
%iFile's inode number in decimal.
%jFile's last attribute change time in the format returned by
the C ctime (3C) function.
A dash (-) is written if the item does not reside in a QFS or Oracle HSM file system.
%JkFile's last attribute change time in the format specified by k,
which is the same as for %Ak.
For more information,
see the %Ak directive previously in this list.
A dash (-) is written if the item does not reside in a QFS or Oracle HSM file system.
%kFile's size in 1K blocks rounded up.
%KSegment number of the data segment or the index inode.
Index inodes always have segment number 0. Data segments are numbered sequentially starting with 1.
A dash (-) is written if the item is not an index inode and not
a data segment.
%lObject of symbolic link. Empty string if file is not a symbolic link.
%mFile's permission bits in octal.
%nNumber of hard links to file.
%pFile's name.
%PFile's name with the name of the command line argument under which it was found removed.
%QNumber of data segments that comprise the segmented file.
A dash (-) is written if the item is not a segmented file.
%rFile's stripe group number as it was set using the setfa -g command.
A dash (-) is written if the file's stripe group number was not
set using setfa -g or if the file does not reside in a
StorageTek QFS file
system. For more information on the setfa -g command,
see the setfa (1) man page.
%RThe WORM retention period for a WORM capable directory or WORM file in YYYYy, DDd, HHh, MMm format. If the retention period is 0, "permanent" is written.
A dash (-) is written if the item is not a WORM, or does not reside
in a QFS or Oracle HSM file system.
%sFile's size in bytes.
%tFile's last modification time in the format returned by
the C ctime (3C) function.
%TkFile's last modification time in the format specified by k,
which is the same as for %Ak.
For more information,
see the %Ak directive previously in this list.
%uFile's user name, or numeric user ID if the user has no name.
%UFile's numeric user ID.
%wFile's stripe width as it was set using the setfa -s command.
A dash (-) is written if the file's stripe width
was not set using setfa -s or if the file
does not reside in a StorageTek QFS or Oracle HSM
file system. For more information
on the setfa -s command, see the setfa (1) man page.
%WThe retention state of the item. If the WORM is capable for a directory, worm-capable is written, or active or over is written for a file.
A dash (-) is written if the item is not a WORM, or does not reside
in a QFS or Oracle HSM file system.
%XFile's date the WORM retention period will expire in the format of %c of the
C strftime (3C) function. If the retention period is 0 (never expire),
"*" is written.
A dash (-) is written if the item is not a WORM, or does not reside
in a QFS or Oracle HSM file system.
%yFile's residence time in the format returned by
the C ctime (3C) function.
A dash (-) is written if the item does not reside in a QFS or Oracle HSM file system.
%YkFile's residence time in the format specified by k,
which is the same as for %Ak.
For more information,
see the %Ak directive previously in this list.
A dash (-) is written if the item does not reside in a QFS or Oracle HSM file system.
%ZSegment length setting in megabytes. A dash (-) is written if the
item does not have the segment attribute set.
-pruneAlways yields true. Does not examine any directories
or files in the directory structure below the pattern
just matched. If -depth is specified, -prune has
no effect.
-lsTrue. Writes information on the current file to standard output.
The information written is in ls (1) command format
with -dils options. For more information on
the ls (1) command, see the ls (1) man page.
POSIXLY_CORRECT environment variable is set,
block counts are in 512-byte blocks.
An expression can contain one or more operators. The following operators are listed in order of decreasing precedence:
Action
( expr )Forces precedence.
! exprTrue if expr is false.
-not exprSame as ! expr.
And (implied). expr2 is not evaluated if expr1 is false.
-a expr2Same as expr1 expr2.
-and expr2Same as expr1 expr2.
-o expr2Or. expr2 is not evaluated if expr1 is true.
-or expr2Same as expr1 -o expr2.
, expr2List. Both expr1 and expr2 are always evaluated. The value of expr1 is discarded. The value of the list is the value of expr2.
Example 1. The following command finds
all files in the ∕sam4 directory that are not archived:
sfind ∕sam4 ! -archived
Example 2. The following command finds all regular files in the current directory that are archived, online, and are nonzero in length:
sfind. -archived -online ! -empty -type f -print
Example 3. The following command finds
all regular files in the current directory that have archive
copies on VSNs matching the shell pattern TP??3?. Note that
shell wildcard characters must be escaped or quoted.
sfind. -vsn "TP??3?" -type f
Alternatively, the following command could be used:
sfind. -vsn TP\\?\\?3\\? -type f
Example 4. The following command prints the modification time of
all files in ∕sam6:
sfind ∕sam6 -printf "file %f mod time %Aa %Ab %Ad %AY %AT\\n" file file7 mod time Fri Nov 12 1999 18:44:27
Example 5. The following command finds all files on ∕sam6 that
have at least one archive copy that has sections on more than one VSN,
i.e. all files on ∕sam6 that have at least one archive copy
that overflows VSNs.
sfind ∕sam6 -ovfl -print
Example 6. The following command finds all files on ∕sam6 that
have at least one archive copy that has sections on more than one VSN,
but fewer than five VSNs.
sfind ∕sam6 -sections +1 -sections -5 -print
Example 7. The following command finds all files in ∕sam6 whose
stripe group was set to a value greater than 3 but less than 8 and whose
stripe width was set to a value greater than 1, but less than 5. It prints
the file's path, stripe group number and stripe width value:
sfind ∕sam6 -type f -setfa_g +3 -setfa_g -8 -setfa_s +1 -setfa_s -5 \\ -printf "Path: %p, g%r, s%w\\n" Path: ∕sam6∕seismic_scan∕030610∕1200∕scn.dat, g4, s2
Example 8. The following command finds all files in ∕sam6 which
have disk archive copies on disk volume "diskv1" in file "d1∕d4∕d201∕f107".
sfind ∕sam6 -vsn diskv1 -archpos d1∕d4∕d201∕f107
The sfind (1) command exits with status
of 0 if all files are processed successfully.
It exits with a status greater than 0 if errors occur.