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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux