How to Zip a Folder in Ubuntu Linux. Learn to zip folder via Linux command. You can zip all files in a directory in Ubuntu – zip multiple files and zip folder and subfolders in Linux Ubuntu System.
zip is a compression and file packaging utility for Unix and Unix-based Systems. The program is useful for packaging a set of files for distribution; for archiving files; and for saving disk space by temporarily compressing unused files or directories.
The zip program puts one or more compressed files into a single zip archive, along with information about the files (name, path, date, time of last modification, protection, and check information to verify file integrity). An entire directory structure can be packed into a zip archive with a single command. Compression ratios of 2:1 to 3:1 are common for text files. zip has one compression method (deflation) and can also store files without compression. (If bzip2 support is added, zip can also compress using bzip2 compression, but such entries require a reasonably modern unzip to decompress. When bzip2 compression is selected, it replaces deflation as the default method.) zip automatically chooses the better of the two (deflation or store or, if bzip2 is selected, bzip2 or store) for each file to be compressed.
Zip Command Format
The basic command format is
zip command-option output_file_name input_1 input_2
Command 1
zip -r filename.zip folder
Command 2
zip -r filename.zip folder1 folder2
Command 3
zip -r filename.zip /path/to/folder1 /path/to/file2
Create Zip Using GUI
Simple, select the files and folders you wish to Zip. Then, right click on to them and select Compress. Now here you will have to select the compression options – zip or tar.xz or 7z. Select the one and click CREATE button. It will create the Zip archive.