FG
💻 Software

Include empty directories in zip file with Linux

Fresh5 days ago
Mar 15, 202612719 views
Confidence Score0%
0%

Problem

I'm trying to zip a directory a linux using the following command: This works, but it isn't include the empty directories that I want to be included in the zip file. How can I get them to be included?

Error Output

zip -r file.zip .

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Include empty directories in zip file with Linux

Low Risk

The answer you're most likely looking for is: zip -r file.zip . -i \* You get a warning when zipping an empty folder but again the solution is size-agnostic for its function. It works for empty and non-empty directories. This solution works in the r…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment