문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top