PDF download Download Article PDF download Download Article

Zip files are one of the primary file types for archiving and compressing multiple files into one directory. All operating systems have the ability to make Zip files, and you can easily do this in Linux as well. This wikiHow article teaches you how to make and unzip a zip file in Linux/UNIX/Mac.

Method 1
Method 1 of 2:

Using the Terminal

PDF download Download Article
  1. The Terminal is where you can enter command-line functions in Linux. It is available in all Linux distributions. Press Ctrl + Alt + T to open the Terminal.
    • On most Linux distributions that have a graphical user interface, you can open the terminal by opening the Apps menu and clicking on the icon that resembles a black screen with a white text cursor.
  2. Zip does not come pre-installed on all Linux distributions, type the following command and press Enter to install Zip on Linux:
    • Ubuntu and Debian: sudo apt install zip
    • CentOS and Fedora: sudo yum install zip .
    Advertisement
  3. To do so, type cd followed by the path that contains the file or folder. and press Enter .
    • For example, if the file you want to zip is in your "Documents" folder, you would type cd Documents and press Enter .
  4. Replace "zip_file.zip" with the name of the zip file you want to create. Replace "file1," "file2," and "file3" with the names of the files or folders you want to compress into a zip file. Then press Enter . [1]
    • This command will not work if there is a space in the file name or folder you want to zip.
    • You can add as many files and folders to the end of the command as you want.
    • Add -r after "zip" in the command to include all subfolders in a folder to the zip file. For example zip -r zipfile.zip folder
    • Add -e after "zip" in the command to add a password to the zip file. You will then be asked to enter and verify a password.
  5. Replace "zip_file.zip" with the actual name of the zip file. [2]
  6. Advertisement
Method 2
Method 2 of 2:

Using the Graphical User Interface

PDF download Download Article
  1. Each distribution of Linux is a little bit different. These steps may be a little different on your Linux distribution but should be fairly similar. Click the icon that resembles a folder to open the Files app or whichever file browser app you are using.
  2. You can zip an entire folder or an individual file. Use the file browser to navigate to the file or folder you want to compress into a zip file.
  3. This displays a context menu.
  4. It's in the context menu. On some Linux distributions, this might say "Archive," "Zip," or something similar.
  5. Enter the name of the file you want to create in the space below "Archive Name."
    • Some Linux distributions may use a default name instead of allowing you to enter a name for the file you are creating.
  6. It's the first option below the field with the archive name.
    • Alternatively, you can select ".tar.xz," which is a compressed archive format used by LInux computers. You can also select ".7z," which is a 7-zip file. 7-zip is an open-source version of Winzip.
  7. It's either in the upper-right corner or lower-right corner of the dialogue box. On some distributions, this may say "Ok" or something similar. This creates a zip file of the file or folder.
  8. Advertisement

Expert Q&A

Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      Warnings

      • If you zip up a file, change it, and then try to unzip it up, it will ask you if you want to replace the modified file with the file in the zip file.
      Advertisement

      About This Article

      Article Summary X

      1. Open the Terminal.
      2. Type " sudo apt install zip " and press Enter to install ZIP.
      3. Type " cd " followed by the path of the file or folder you want to zip.
      4. Type " zip zip_filename.zip filename1 filename2 filename3 " and press Enter .

      Did this summary help you?
      Thanks to all authors for creating a page that has been read 85,353 times.

      Is this article up to date?

      Advertisement