V
V
vfvnvsyevsky2015-06-13 22:13:54
linux
vfvnvsyevsky, 2015-06-13 22:13:54

How to archive all files of any nesting in a folder in Linux?

Let's say there is a folder that contains n-folders and files, which also contain n-folders and files, etc. You can calculate the maximum nesting and do everything with a command like

zip file.zip file/*/*/*...
, but I think there should be a more concise way.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vlad Zhivotnev, 2015-06-13
@inkvizitor68sl

tar -czvf archive.tar.gz /path/to/archived/dir

S
ShamblerR, 2015-06-15
@ShamblerR

zip -r -0 archive.zip .
where dot is the current folder.

S
Sergey N, 2015-06-18
@Albibek

If you want to limit archiving by depth, you can use
find -maxdepth N

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question