Matthew Rosewarne on 16 Oct 2008 11:58:22 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] CLI for "find" text string in an unknown file

On Thursday 16 October 2008, Tim Allen wrote:
> Example, to delete a bunch of files from such a directory (don't try this
> at home if you're not sure of what you're doing!):
> find ./* | xargs rm
> Another trick I use to automatically compress uploaded images (requires
> ImageMagick) that our field technicians failed to use an automated program
> to resize / compress:
> find ./ -size "+200k" | xargs mogrify -quality 60 -geometry 600x10000

Unless you know you won't have any files with spaces in their names, you 
should use:
	find {things} -print0 | xargs -0 {command}

Otherwise any spaces in file names will confuse xargs.

Attachment: signature.asc
Description: This is a digitally signed message part.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --