Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Using the find command in command substitution constructs z/OS UNIX System Services User's Guide SA23-2279-00 |
|
The find command is useful in command
substitution constructs. find displays the
names of files that have specified characteristics. For example:
finds
all files in the directory dir1 whose names match the wildcard
pattern *.c. In other words, it finds all files in
that directory with names having the .c suffix.The command:
finds
all the .c files and then uses ls to
display information about these files.Complicating things further, you could enter
This
sets up a pipeline that displays ls information
only for files that were last changed in November. (To be perfectly
accurate, it also displays information about files that have the string Nov in
their names, too.)Another useful find option has the form:
This
says that you want to find files that have changed in the last number of
days. For example:
displays ls information
about all files that changed either yesterday or today.On many UNIX and AIX® systems, the find command
prints out the file names only if you specify the –print option.
Thus, you would have to enter:
to
get the results just described. The z/OS UNIX find command
automatically prints its results without –print.
However, if you have an existing shell script or compatibility with UNIX systems is important to you,
you can use –print.For more information about the find command, see the find command description in z/OS UNIX System Services Command Reference. |
Copyright IBM Corporation 1990, 2014
|