UNIX: Zip Example

last updated in Categories

Can you provide zip command examples under UNIX? How do I use zip command under UNIX operating systems?

The zip command under UNIX is use for a compression. It works as a file packaging utility for the following operating systems:

  1. Unix
  2. VMS
  3. MSDOS
  4. OS/2
  5. Windows 9x/NT/XP,
  6. Minix
  7. Atari
  8. Macintosh
  9. Amiga
  10. Acorn RISC OS.

The command is tottally compatible with PKZIP (Phil Katz’s ZIP for MSDOS systems). The zip command is pretty good for packaging a set of files for distribution and/or for archiving files; and for saving disk space by temporarily compressing unused files or directories.

Simple Examples

The syntax is as follows:

zip file.zip file1.txt file2.doc photo.jpg ...

To zip resume.doc and all *.c file, enter:
zip bacup.zip resume.doc *.c
To zip data directory, enter:
zip -r backup.zip data

See also:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.