Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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. – Копать_Шо_я_нашел Jan 11 '14 at 16:58

How about :

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

Your Answer


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.