How to zip and rename a directory tree

Posted by Kev on Super User See other posts from Super User or by Kev
Published on 2010-12-30T09:15:31Z Indexed on 2010/12/30 9:56 UTC
Read the original article Hit count: 209

Filed under:

I have a lot of music in a lot of directories:

./artist1/album1/*.mp3
./artist1/album2/*.mp3
./artist1/album3/*.mp3
./artist2/album1/*.mp3
./artist2/album2/*.mp3
./artist3/album1/*.mp3
./artist3/album2/*.mp3
... ...

How can I zip them to this:

./artist1/album1/*.mp3  => ./artist1-album1.tar.gz
./artist1/album2/*.mp3  => ./artist1-album2.tar.gz
./artist1/album3/*.mp3  => ./artist1-album3.tar.gz
./artist2/album1/*.mp3  => ./artist2-album1.tar.gz
./artist2/album2/*.mp3  => ./artist2-album2.tar.gz
./artist3/album1/*.mp3  => ./artist3-album1.tar.gz
./artist3/album2/*.mp3  => ./artist3-album2.tar.gz
... ...

I'd like one-line-command or a simple script.

© Super User or respective owner

Related posts about zip