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:
- Open Files.
Here’s how: Press Super (usually the Windows or Command key), start typing
filesand open the Files application.
Keyboard shortcut: You can set up a keyboard shortcut for launching Gnome Files. - 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.
- 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. - Click on one of the files or folders with the right mouse button.
- Select Compress… from the context menu that has opened.
- Type the name you would like to use for the file under Archive name.
- Select .zip as the extension.
Other formats: You can also use 7z (7-Zip) or tar.xz (XZ compression).
- Click Create.
All zipped up and suited to send?
Tips help fuel these email and tech how-tos.
Using KDE
To create a ZIP file archive using the KDE Plasma desktop:
- 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. - Open the Dolphin file browser.
- Go to the folder that contains the files you want to compress.
- Highlight all the files and folders you want to add to the ZIP file.
- Click on one of the files or folders with the right mouse button.
- 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.
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:
- Open your preferred terminal application.
Here’s which: Launch Console on Gnome, for example, Konsole on KDE or Xterm if all else fails. - Typically, navigate to the directory that holds the files you want to compress.
Here’s how: Typecdfollowed by the path;~(tilde) stands in for your home directory.
Example:cd ~/Documentswill take you to your account’s Documents folder. - 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-rmakes 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-roption) or use shell pattern matching to include all files of a specific type, for example in the ZIP file.
Example: The commandzip ladedu *.pdf La\ De\ Du/*.pdfwill 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. - Press Enter.
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 ofzip -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)