Answer the question
In order to leave comments, you need to log in
How to create archives according to the principle 1 archive -1 folder?
Hello !
Linux
There is a folder with a bunch of directories and a bunch of different files in there.
You need to create archives of each directory with the files that are in them.
Name archives by folder names.
I suspect that find should help,
but so far it doesn't work :-(
Answer the question
In order to leave comments, you need to log in
find. -maxdepth 0 -type d -name "*" -exec tar cvfz {}.tgz {} \;
even more precisely
find ./* -maxdepth 0 -type d -exec tar cvfz {}.tgz {} \;
The simplest python script will solve your problem. Recursive traversal of the directory, for each of the directories encountered - launching the archiver in the mode when only files are archived.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question