PDA

View Full Version : Linux compress/pack/archive/gzip each folder into its own archive



Fli
05-30-2015, 04:56 PM
What are ways to archive one folder subfolders so each subfolder is in its own separate tar / tgz archive?

here is one way:

go to directory with subdirectories
# cd /path/to/directory

# find subdirectories in current directory (no subdirectories) and archive them
find . -maxdepth 0 -type d -exec tar czf {}.tgz {} \;