Unix/Linux Go Back    

Calling a find/remove within a script

Shell Programming and Scripting

Kindly Note - This is a Single User Post by Forum Member RudiC Regarding:
Calling a find/remove within a script.
Please Follow The Primary Link Above to View the Full Discussion.

Old Unix and Linux 05-16-2017   -   Original Discussion by jeffs42885
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Join Date: Jul 2012
Last Activity: 21 April 2018, 1:54 PM EDT
Location: Aachen, Germany
Posts: 12,504
Thanks: 401
Thanked 3,877 Times in 3,564 Posts
Originally Posted by AbelLuis View Post
The final \; for the exec clause is mandatory. I don't know why you add the plus sign to the filename : {}+ .


-exec gzip {} \;

Not necessarily. man find (on my linux: find (GNU findutils) 4.7.0-git)
-exec command {} +
This variant of the -exec action runs the specified command on the selected files, but the command line is built by appending each selected file name at the end; the total number of invocations of the command will be much less than the number of matched files.
But: a space before the + may be compulsory.