How to Zip File in LinuxLevel of difficulty: Intermediate
Compressing files is necessary to reduce its size for storage and transfer. Another purpose of compressing the files is to save disk space by temporarily packing the unused file. Zip is a compression utility for Linux, Windows NT, Minix, Atari and Macintosh, VMS, MSDOS and OS/2.
- Computer with Linux Operating System
- zipped files
- zipped files
Linux contains a Zip program. The application is not installed in the Operating System by default. Open the application to install the zip program using shell prompt. Locate System Tools from Application and go to Terminal.
Type the command '# apt-get install zip' to install the program. Type 'apt-get install unzip' to also install the unzip program for the Linux Operating System. The unzip program may later be used to unpack the compressed files. The unzip application may also test, list, and extract files from zip archive.
Use the 'yum' commands if the computer’s Operating System is Red Hat Linux/Fedora. The commands are '# yum install zip' for the zip tool and '# yum install unzip' for the unpacking tool.
Type the command 'zip' and the name of the data for archiving to create the compressed version of the files. A sample for this is by typing the command $ zip file name. All the files in existing directory of the file name will be compressed with the name filename.zip. There is no need to type .zip in the end of the file name. The zip command will automatically add the zip suffix in the compressed version of the file.
Type the command 'zip –r' and the name of the file. This is for archiving of the whole directory. This will include all subdirectories. A sample for this commands is by typing the '$ zip –r' directory name.
Type the command 'zip -r', the source’s name, and the intended file name for the output. This is to zip a file under a different file name from the original source.
Use the command 'unzip' to extract files from a zip archive. A sample for this is by typing '$ unzip filename.zip'. This will extract all the files from the archive. The location of the extracted files is in current directory and subdirectories.
There is also a command for extracting one or several files only from the archive. The command is '$ unzip archive name.zip filename.fileformat'. A sample for this is by extracting the xx.doc from the yy archive. The command will be '$ unzip yy.zip xx.doc'.
Windows system maintenance:
You are currently viewing How to Zip File in Linux on Uniblue's how to archive.
Browse more how to's
- How to Zip File in Linux
- How to Zip a File with WinZip
- How to Zip a Movie File
- How to Zip a PDF File
- How to Zip and Compress a File
- How to accept cookies
- How to access another computer
- How to access router
- How to access the internet
- How to activate windows 7
- How to activate windows xp
- How to add a hard drive
- How to add memory to laptop
- How to add network printer
- How to add subtitles to a dvd
- How to advertise a website
- How to advertise your website
- How to allow cookies
- How to assemble computer
- How to assemble pc