FG

zip/tar/? files with depth parameter

Fresh3 days ago
Mar 15, 20263107 views
Confidence Score0%
0%

Problem

I would like to zip files from a directory but only to a given depth. In the example below I would like to include files until a depth of 3: If I could issue: I would have the following output: How can I achieve this? Should I use tar, or is there any other common tool in Linux?

Error Output

dir0/
 dir1/
     dir2 -> subdir1, subdir2
     dir3 ->
     file1

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: zip/tar/? files with depth parameter

Low Risk

Use with to limit the traversal depth, then use the tool's option to take filenames from stdin, or xargs or command substitution.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment