Zipping and Unzipping Files under Linux

Asked by Yamir via e-mail


Question: MS-Windows has winzip program. I cannot find anything under Application menu to zip or unzip files on Linux. I am using Debian Linux. How do I zip and unzip file under Linux operating systems?

Answer: Linux has both zip and unzip program. By default, these utilities are not installed. You can install zip/unzip tools from the shell prompt. Open the Terminal by clicking on Application > System Tools > Terminal. You must be a root user, Type the following two commands to install zip and unzip program on Debian or Ubuntu Linux:

# apt-get install zip
# apt-get install unzip

$ sudo apt-get install zip unzip
If you are Red Hat Linux/Fedora/CentOS Linux user then you can use the yum command to install zip and unzip program as follows:

# yum install zip
# yum install unzip
  • zip is a compression and file packaging utility for Linux and Unix (including FreeBSD, Solaris etc).
  • unzip will list, test, or extract files from a ZIP archive files.

ziping files/directories examples

Creates the archive and puts all the files in the current directory in it in compressed form, type:

$ zip data *

Note: No need to add .zip extension or suffix as it is added automatically by zip command.
Use the ls command to verify new zip file:
$ ls
To zip up an entire directory (including all subdirectories), type the following command:

$  zip -r data *

unziping files/directories examples

To use unzip to extract all files of the archive into the current directory & subdirectories:

$ unzip

You can also test, printing only a summary message indicating whether the archive is OK or not:

$ unzip -tq

To extract the file called cv.doc from

$ unzip  cv.doc

To extract all files into the /tmp directory:

$ unzip  -d /tmp

To list all files from

$ unzip -l

Linux GUI packages

You can use the following graphics packages

(1) KDE Desktop: Ark is an Archive Manager for the KDE Desktop. You can start Ark from Application > Accessories.

(2)GNOME Desktop: File Roller ia an Archive Manager for the GNOME Desktop.

See also

For more information please consult the following resources:

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

26 comments… add one
  • Salem Nov 22, 2015 @ 11:56

    it’s like many people facing issue archiving their files on linux .
    in shor zip and unzip command not provided with linux distrbutions by dfualt .
    so we need to use tar command instead .:-
    BTW tar defualt stting not zipping file but put it on one uncompressed file with .tar extention .
    to compress with tar
    tar -czf ~/backup-archive.tar.gz ~/backup/
    ~/backup/ is the targit directory
    to uncompress on current directory
    tar – ~/backup-archive.tar.gz
    To uncmpress to specified directory
    tar -xzvf ~/backup-archive.tar.gz -C /target/directory

    This is best way compress uncompress on linux command line .

  • Ari Feb 2, 2016 @ 8:43

    Still, can’t use it..

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.