Basic ZIP Extraction Commands
Linux provides several built-in commands for extracting ZIP archives. The most commonly used commands are:
unzip
Command
The unzip
command is the primary tool for extracting ZIP archives on Linux. It allows you to extract the contents of a ZIP file to the current directory or a specified location.
Example usage:
unzip archive.zip
This command will extract all the files from the archive.zip
file to the current directory.
You can also extract the ZIP archive to a specific directory:
unzip archive.zip -d /path/to/extract/directory
zip
Command
The zip
command can also be used to extract ZIP archives, although it is more commonly used for creating ZIP archives.
To extract a ZIP archive using the zip
command, you can use the -u
(update) or -d
(extract) options:
zip -u archive.zip /path/to/extract/directory
This command will extract the contents of the archive.zip
file to the specified directory.
zip -d archive.zip "file_to_extract"
This command will extract a specific file from the archive.zip
file.
In addition to the command-line tools, Linux also provides graphical file managers that can be used to extract ZIP archives. For example, the default file manager in Ubuntu, called Files (or Nautilus), can be used to extract ZIP archives by simply double-clicking on the archive file.
These basic ZIP extraction commands should provide you with a solid foundation for working with ZIP archives on your Linux system. In the next section, we'll explore some more advanced techniques for extracting ZIP archives.