How to Create ZIP Files on Linux (Gnome, KDE, Terminal)

How to Create ZIP Files on Linux

by Heinz Tschabitscher | Nov 28, 2025 | Useful Tech

You’ve gathered a pile of files, and now you watch your email chokes on the attachment size. You want to archive multiple directories in one neat little package on your Linux machine, but where and how feels elusive. Linux has several ways to create ZIP files, whether you prefer the graphical ease of KDE and Gnome or the power of the terminal. Find out here how to create ZIP files (and TAR.XZ archives) on Linux using Gnome, KDE and the command line.

First, Read the Full-Weight Manual

The majestic Boeing 747 leapt off runways around the world in the 1970s in its classic “dash 100” incarnation with a maximum payload of 76.28 tons.

The intricate jumbo jet’s documentation was counted, I have been told, in tens of thousands of pages — three thousand of them! That made for some 31 million pages of diagrams, charts and instructions.

Now, if we assume 5.5 grams for an A4-sized page that documentation weighed about… 86.49 tons.

Let’s hope the printers were able to fit 2 pages on 1 — or the documents were compressed in some other fashion:

How to Create ZIP Files on Linux (and TAR.XZ) with Gnome, KDE and the Terminal

Using Gnome

Time needed: 1 minute

To archive files and folders in a compressed ZIP file using Gnome Files on Linux:

  1. Open Files.

    Here’s how: Press Super (usually the Windows or Command key), start typing files and open the Files application.
    Keyboard shortcut: You can set up a keyboard shortcut for launching Gnome Files.

  2. Go to the directory that contains the files and folders you would like to compress to a ZIP file.

    Here’s how: You can use the sidebar to navigate or type the path to the directory in the location bar at the top of the Files window.

  3. Highlight all the documents and folders you want to include in the ZIP file.

    Here’s how: You can draw an outline over the desired files to make a selection.
    Add and subtract: Hold down Ctrl while you click a file or folder to toggle its inclusion in the selection.
    Everything: Press Ctrl A to select everything in the current directory.

  4. Click on one of the files or folders with the right mouse button.

  5. Select Compress… from the context menu that has opened.

    Select “Compress” in Files to create a ZIP file with Gnome on Linux

  6. Type the name you would like to use for the file under Archive name.

  7. Select .zip as the extension.

    Other formats: You can also use 7z (7-Zip) or tar.xz (XZ compression).

  8. Click Create.

    Enter the desired name for the ZIP file and click “Create”

All zipped up and suited to send?

Buy La De Du a tea

Tips help fuel these email and tech how-tos.

Using KDE

To create a ZIP file archive using the KDE Plasma desktop:

  1. Make sure the Ark compression utility is installed.
    No Ark: Ark adds capabilities for compressing to KDE Dolphin; without it, you can resort to compressing using a terminal — see below.
  2. Open the Dolphin file browser.
  3. Go to the folder that contains the files you want to compress.
  4. Highlight all the files and folders you want to add to the ZIP file.
  5. Click on one of the files or folders with the right mouse button.
  6. Select Compress | Here as "Archive.zip" from the context menu that has appeared.
    Other name: You can change the name afterwards or resort to opening more compression options.
    Other options: Select Compress | Compress to… for additional options including compressing to the highly efficient TAR.XZ, for example, which can be extracted on Windows 11 and macOS in addition to Linux.
    Compress folders into a ZIP file using KDE Dolphin

Back again: How to Unzip Files on Linux (Gnome, KDE, Terminal)

Using a Terminal

To create a ZIP file on Linux using a terminal prompt:

  1. Open your preferred terminal application.
    Here’s which: Launch Console on Gnome, for example, Konsole on KDE or Xterm if all else fails.
  2. Typically, navigate to the directory that holds the files you want to compress.
    Here’s how: Type cd  followed by the path; ~ (tilde) stands in for your home directory.
    Example: cd ~/Documents will take you to your account’s Documents folder.
  3. Type zip -r <filename> * to compress the complete current folder including all folders under it and their files to a ZIP file called <filename>.zip.
    Here’s why: The option -r makes zip traverse the directory tree under the current one; * selects all files (excluding hidden files whose name starts with a dot).
    Specific files: You can also specify a list of files to compress, of course (without the -r option) or use shell pattern matching to include all files of a specific type, for example in the ZIP file.
    Example: The command zip ladedu *.pdf La\ De\ Du/*.pdf will create a ZIP file called ladedu.zip that contains all PDF files in the current directory and in the folder called La De Du that’s in the current directory.
  4. Press Enter.
    Create a ZIP file on the Linux command line using zip

Using Windows? How to Create a ZIP File in Windows
On a Mac? How to Zip Files on a Mac (without “__MACOSX”)

How to Create ZIP Files on Linux (and TAR.XZ) with Gnome, KDE and the Terminal: FAQ

Can I open ZIP files created on Linux on other operating systems?

Yes.

ZIP files created with the Linux desktops and zip on the command line can be opened on Mac and Windows just fine, as can 7-Zip, bzip2 and TAR.XZ files, for example.

Why ZIP? How to Attach and Send a Folder by Email in Gmail
What to Zip: How to Download All Gmail Emails in Bulk

How can I include hidden files in the ZIP file?

To archive all files — Including hidden files — using a terminal command on Linux:

  • Use zip -r <filename> . (instead of zip -r <filename> *).
    Here’s why: The dot . selects all files including hidden files starting with a dot.

(Tested with Gnome 46–49 and KDE Plasma 6; first published September 2024, last updated November 2025)

Home » Useful Tech » How to Create ZIP Files on Linux (Gnome, KDE, Terminal)