Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using s3cmd top copy files to S3 but I want to exclude all files that begin with 00 and are a JPEG.

I'm trying --exclude=00*.jpg with no success.

Any idea how to do this?

share|improve this question
    
Is that s3cmd? Try --exclude '00*.jpg'. –  ott-- Jul 29 '12 at 9:31

2 Answers 2

shopt -s extglob
ls !(00*.jpg)
share|improve this answer
    
+1, thanks a lot. But it adds some unwanted behaviour. It lists content not of only the current directory(as ls does by default) but also included directories too. –  gekannt Jan 11 at 16:58

How about :

for n in $(/bin/ls | grep -v "^00.*.jpg"); do s3cmd $n; done
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.