Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find command giving me a tough time

Status
Not open for further replies.

IMAUser

Technical User
May 28, 2003
121
CH
Hi there,

I have this command

find . \( ! -name '*.gz' \) -mtime +7

Which shows me all the files not accessed in the last seven days and are not having extension of .gz . So logically speaking

find . \( ! -name '*.gz' \) -mtime +7 -exec gzip {} \;

This should gzip the files.
But for some reason, it dosent gzip and since the command is valid there isnt an error either. Have spent a lot of time but no getting anywhere. Any ideas folks ?

Thanks
 
Some flavor of
Code:
 find
need \{\}.

Hope This Help
PH.
 
How about this:

find . \( ! -name '*.gz' \) -mtime +7 | xargs gzip

-jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top