$ for i in *;do tar zcvf ${i}.tgz $i; rm -fr $i;done
Exemplo
$ for i in *;do tar zcvf ${i}.tgz $i; rm -fr $i;done
stresstest/
stresstest/file1
stresstest/file2
stresstest/file3
$ ll
total 4
-rw-r--r-- 1 root root 162 Jul 5 05:18 stresstest.tgz