foreach d in $( find . -type d -depth 1 -print ) do tar czf $d.tar.gz $d && \ rm -rf $d done