Want to compress multiple files and folders in a single archive and share it to boot? Find out here how to create ZIP files (as well as TAR.XZ files) 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
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
files
and 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.
On Windows? How to Create a ZIP File in Windows
Using KDE
To crate 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.
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: Typecd
followed by the path;~
(tilde) stands in for your home directory.
Example:cd ~/Documents
will 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-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 commandzip 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 the current directory. - Press Enter.
Also on the command line: How to Zip Files on a Mac (without “__MACOSX”)
How to Create ZIP Files on Linux: 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.
(How to create ZIP files on Linux tested with Gnome 46 and KDE Plasma 6.1; first published September 2024)