How to execute more than one command with find -exec?
From: Cheng Mo (mo.cheng_at_nospam.nospam)
Date: 11/18/04
- Previous message: mjt: "Re: Partitioning problems on Maxtor 80Gb drive"
- Next in thread: IANAL_VISTA: "Re: How to execute more than one command with find -exec?"
- Reply: IANAL_VISTA: "Re: How to execute more than one command with find -exec?"
- Reply: gordian: "Re: How to execute more than one command with find -exec?"
- Reply: noi: "Re: How to execute more than one command with find -exec?"
- Reply: Jitender Singh: "Re: How to execute more than one command with find -exec?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Nov 2004 17:35:30 +0800
The scenario is:
In folder XXX there are lots of *.gif files. Those *.gif files whose
filename don't appear in file abc.txt should be deleted. I want to do
this job in one line command.
find XXX -name "*.gif" -exec ........... \;
But I don't know how to write the part of ..............
I tried
find XXX -name "*.gif" -exec grep {} abc.txt || rm {} \;
But it seems -exec don't take behind as a combination of two commands.
Anybody can tell me how to execute more than one command with find -exec?
Thanks
- Previous message: mjt: "Re: Partitioning problems on Maxtor 80Gb drive"
- Next in thread: IANAL_VISTA: "Re: How to execute more than one command with find -exec?"
- Reply: IANAL_VISTA: "Re: How to execute more than one command with find -exec?"
- Reply: gordian: "Re: How to execute more than one command with find -exec?"
- Reply: noi: "Re: How to execute more than one command with find -exec?"
- Reply: Jitender Singh: "Re: How to execute more than one command with find -exec?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|