#!/bin/bash for i in {10..12}; do find . -maxdepth 1 -type d|grep "Prices_2014-${i}"|xargs tar cvf "prices_2014-${i}.tar.xz" -I pixz; done