find

Purpose

Displays the absolute paths of all occurrences of the specified name pattern (with wildcards) in a specified directory and its subdirectories.

Syntax and Description

find [--type type] dir pattern

Table 10-34 lists the syntax options for the find command.


Table 10-34 Options for the find command

Option Description

--type type

Type of target to find.

dir

Directory name where you want to start searching.

pattern

Name of a target or a wildcard pattern.


This command searches the specified directory and all subdirectories under it in the directory tree for the supplied pattern. The value used for pattern can be a directory name or a file name, and can include wildcard characters. See "Wildcard Characters".

The ASMCMD find command is case insensitive.

In the output of the command, directory names are suffixed with the slash character (/) to distinguish them from file names.

Use the --type flag to find all the files of a particular type (specified as type). For example, you can search for control files by specifying type as CONTROLFILE. Valid values for type are listed in Table 5-1. These are type values from the type column of the V$ASM_FILE view.

Examples

The following are examples of the find command. The first example searches the data disk group for files that begin with undo. The second example returns the absolute path of all the control files (--type CONTROLFILE) in the +data/orcl directory.

Example 10-43 Using the ASMCMD find command

ASMCMD [+] > find +data undo*
+data/ORCL/DATAFILE/UNDOTBS1.258.691577151

ASMCMD [+] >  find --type CONTROLFILE +data/orcl *
+data/orcl/CONTROLFILE/Current.260.691577263