← All commands
Topic hub File Management
Windows Linux File Management Expanded guide Archives & Compression

Windows Compress-Archive equivalent in Linux

Compresses files or folders into a standard ZIP archive.

Windows Compress-Archive
→
Linux equivalents
Debian/Ubuntu same command
zip -r archive.zip folder/
Fedora same command
zip -r archive.zip folder/
Arch same command
zip -r archive.zip folder/

Overview

What this command does

On Windows, "Compress-Archive" is used to create a ZIP archive. On Linux, the closest practical mapping shown here is "zip -r archive.zip folder/". Compresses files or folders into a standard ZIP archive. This reference is grouped under File Management → Archives & Compression.

Migration tip: The Linux <code>zip</code> utility is the closest match to PowerShell <code>Compress-Archive</code>. Use <code>-r</code> when the source contains directories.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows Compress-Archive maps to zip -r archive.zip folder/ for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Command-specific caution

Existing archive entries may be updated rather than replaced. Delete the old archive first when you need a completely fresh result.

Practical tasks

Common use cases

Create a ZIP archive

Compresses files or folders into a standard ZIP archive.

zip archive.zip file.txt

Compress one file

zip -r project.zip project/

Compress a directory recursively

zip -9 -r backup.zip Documents/

Use maximum ZIP compression

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

zip archive.zip file.txt
zip -r project.zip project/
zip -9 -r backup.zip Documents/

Walkthrough

Examples with explanations

zip archive.zip file.txt # create an archive containing one file
zip -r project.zip project/ # archive a complete directory
zip -9 -r backup.zip Documents/ # use maximum compression

Reference

Common options and variations

Command or optionUse
zip archive.zip file.txtCompress one file
zip -r project.zip project/Compress a directory recursively
zip -9 -r backup.zip Documents/Use maximum ZIP compression

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "zip -r archive.zip folder/" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command zip -r archive.zip folder/ Same command on this distribution.
Fedora same command zip -r archive.zip folder/ Same command on this distribution.
Arch same command zip -r archive.zip folder/ Same command on this distribution.

Important

What to watch out for

Existing archive entries may be updated rather than replaced. Delete the old archive first when you need a completely fresh result.

Keep learning

Related File Management commands