Skip to content

Instantly share code, notes, and snippets.

@ruario
Last active December 22, 2025 11:52
Show Gist options
  • Select an option

  • Save ruario/a7ab6478007661c77090eeea64b60a02 to your computer and use it in GitHub Desktop.

Select an option

Save ruario/a7ab6478007661c77090eeea64b60a02 to your computer and use it in GitHub Desktop.
Rar vs 7z on Linux

Rar vs 7z on Linux

TL;DR

  • rar: More feature‑rich for archival integrity and file manipulation. Creation is proprietary and requires a license but it is fully free and open for extraction.
  • 7z: Fully open‑source and free to use for both creation and extraction. It can sometimes have marginally better compression ratios.

Rar is preferable to 7z on Linux when you need features 7‑Zip does not provide, such as built‑in recovery records, archive‑level deduplication, more robust multi‑volume handling, stronger resilience against corruption, advanced filters and preservation of basic UNIX ownership and permissions. If you don't need those, or fully open source is a must, then 7z is a reasonable option.

Note: Both actually have pretty equal support for extraction by a third party. You will not realistically find a system that can open .7z but not .rar, or vice versa.

Rar

  • Advantages:
    • Preserves permissions and ownership
    • Supports recovery records for corruption repair
    • Deduplication
    • Secure wipe
    • Path rewriting
    • Search within archived files
    • More advanced file filters
  • Suited for:
    • Archival storage where more control, data integrity and metadata fidelity matter
    • Bundling a few files to quickly share

7z

  • Advantages:
    • Zero cost and open source for creation
    • Often achieves slightly smaller archives
  • Suited for:
    • Bundling a few files to quickly share
    • Situations where licensing is a requirment

Feature rar 7z
UNIX Permissions ✅ Stored/restored by default ❌ Not supported
UNIX Ownership ✅ Supported with -ow ❌ Not supported
Symbolic links ✅ Supported with -ol ✅ Supported with -snl
Hard links ✅ Supported with -oh ✅ Supported with -snh
Deduplication ✅ Supported with -oi ❌ Not Supported
Recovery Records ✅ Supported with rr & rv ❌ Not supported
Secure Wipe -dw (overwrites source files with zeros) ❌ Not supported
Path Rewriting ✅ Supported ❌ Not supported
Archive content search ✅ Supported with i ❌ Not supported
Filtering Options ✅ Rich filters (time, size, attributes) ➖ Basic filters only
Split Volumes ✅ Supported ✅ Supported
Compression Ratio ✅ High ✅ High (occasionally, marginally smaller)
Licensing ⚠️ Proprietary (creation); ✅ Open Source (extraction) ✅ Open Source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment