How to zip and rename a directory tree
- by Kev
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.