Re: Deleting all image files with "small" keyword

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

 



On 11Apr2010 07:54, Joachim Backes <joachim.backes@xxxxxxxxxxxxxx> wrote:
| On 04/11/2010 01:04 AM, Leonard Adjei wrote:
| >using
| >  sudo find AUDIO/  -name \*Small\*.jpg -exec rm  {} \;
| >worked fine for me.
| >
| >Thanks
| 
| this will run the rm command separately for *each found* "small".jpg file.
| 
| Probably faster:
| 
| find AUDIO/  -name \*Small\*.jpg|xargs rm
| 
| This starts rm only once, but depends on the maximum command length
| allowed for your shell.

And depends on not having too weird filenames. Xargs is rather flakey that
way. The usual "nasty filename" fix for find/xargs is to use -print0 with
find and the -0 option to xargs.

BTW, the max command length is usually an artifact of the OS' exec()
system call, not the shell itself - the shell will just malloc enough
room for the command length and then pass it to exec(), which will
refuse if it is too long.

Also, the whole point of xargs is to _circumvent_ the command exec()
limit; it will run "rm" multiple times if necessary to avoid the command
line limit.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

Just because Unix is a multiuser system doesn't mean I want to share it with
anybody!        - Paul Tomblin, in rec.aviation.military
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux