I'm trying to retrieve a file (.gz) and read it automatically after finding it, i want to include this in the [action] part of the 'find' command, unfortunately is for some reason not working. What i'm doing is:
find . -name *20120805.gz -zcat
What i get is: find: invalid predicate `-zcat'
Whats wrong with that action? Any advice?
That is really invalid predicate.
You must use -exec
in this case:
$ find . -name *20120805.gz -exec zcat {} \;
For every file that was found, find
runs zcat
with the name of the file as an argument.