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:
to run "test" without deleting, do:code:find /directory ! -iname "*.mp3" -type f -delete
for multiple filetypes, mess regular expression:code:find /directory ! -iname "*.mp3" -type f
sorry. after posted looked @ man page more. thought name had full regex capabilities, doesn't, , -iregex doesn't it's quite want either.code:find /directory ! -iname "*.(mp3|avi)" -type f -delete
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [SOLVED] simple command line question
Ubuntu
Comments
Post a Comment