Skip to main content

Thread: simple command line question


howdy,

i've got command lets me recursively clean out that's not given file type:

find /target/directory ! -iname '*.mp3' -type f -exec echo /bin/rm -f '{}' \;

run on, say, musician's discography clean out .jpeg's , such. run once "echo" in place check, , without "echo" cleaning.

question is, how include "or" statement in allow, instance, both mp3's , wma's survive cleansing?

advanced thanks,
querent

another way same thing be:
code:
find /directory ! -iname "*.mp3" -type f -delete
to run "test" without deleting, do:
code:
find /directory ! -iname "*.mp3" -type f
for multiple filetypes, mess regular expression:
code:
find /directory ! -iname "*.(mp3|avi)" -type f -delete
sorry. after posted looked @ man page more. thought name had full regex capabilities, doesn't, , -iregex doesn't it's quite want either.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [SOLVED] simple command line question


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

PProHeadless.exe has stopped working error when opening projects in Adobe Media Encoder CS6

Preconditions Failed. - Joomla! Forum - community, help and support