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