0

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?

1
  • Is that s3cmd? Try --exclude '00*.jpg'.
    – ott--
    Jul 29, 2012 at 9:31

2 Answers 2

1
shopt -s extglob
ls !(00*.jpg)
1
  • +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.
    – Tebe
    Jan 11, 2014 at 16:58
0

How about :

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .