Re: Deleting all image files with "small" keyword

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

 



On Sat, Apr 10, 2010 at 09:28:04PM +0000, Leonard Adjei wrote:
> I've been using Fedora for a while, but I must confess that when it
> comes to shell scripting I'm found wanting many a times.
> The thing is, I have an Audio Folder which contains hundreds of track
> with Album arts. Most of the album arts are small and Big, I would
> want a script which would search my audio directory and it sub-folders
> and delete all image files with the term "small" as part of the file
> names (eg, AlbumartSmall, Folder_small etc ...)

Depending upon your exact needs, something like this might do it:

cd <your folder>
find . -maxdepth 1 -name \*Small\* exec rm -i {} \;

if that complains about "command too long" or similar, try this:

find . -maxdepth 1 -name \*Small\* -print | xargs rm -i

this will search only the current directory, not any subdirectories.
if you want to search subdirectories too, remove the "-maxdepth 1".
-- 
---- Fred Smith -- fredex@xxxxxxxxxxxxxxxxxxxxxx ----------------------------
                    Do you not know? Have you not heard? 
    The LORD is the everlasting God, the Creator of the ends of the earth. 
  He will not grow tired or weary, and his understanding no one can fathom.
----------------------------- Isaiah 40:28 (niv) -----------------------------
-- 
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