Skip to content

Create tar of all folders

This command creates one archive per direct subfolder in the current directory.

Terminal window
find . -maxdepth 1 -mindepth 1 -type d -exec tar -czvf "{}.tar.gz" "{}" \;
Terminal window
find . -maxdepth 1 -mindepth 1 -type d -exec tar -cvf "{}.tar" "{}" \;