How to Zip UnZip Files And Directories In Linux using Command Line?
For teams turning “How to Zip UnZip Files And Directories In Linux using Command Line?” into a repeatable delivery task, this workflow reference can document setup, troubleshooting and review time; managers should interpret those records alongside reliability and completed work, not as a stand-alone score.
Package and operating-system behaviour can change, so verify the commands and supported versions through Ubuntu before running them on a production host.
Hello Friends,
In this tutorial, I will show you how to zip unzip files and directories in linux using the command line. you will learn zipping and unzipping files in linux. you will learn how to unzip files in linux. if you want to see an example of how to create and extract zip files to a specific directory in linux then you are in the right place.
Note that a ZIP file is a data container containing one or more compressed files or directories. This tutorial will guide you on how to easily zip and unzip files and directories in Linux/Ubuntu using the command line. Additionally, we will cover how to unzip password-protected files and directories in Linux using the terminal.
How to Zip Files And Directories
zip is not installed by default in most Linux distributions. So, you can easily install it using the following command.
Now open your terminal and execute the following command on it to install the zip package:
sudo apt install zip
sudo yum install zip
To zip one file. So, you can easily zip it by using the following command:
zip filename
To zip one directory. So, you can easily zip it by using the following command:
zip directory_name
To zip multiple files. So, you can easily zip it by using the following command:
zip archivename.zip filename1 filename2 filename3
To zip multiple directories. So, you can easily zip it by using the following command:
zip -r archivename.zip directory_name1 directory_name2 file1 file1
To create password protected zip file in the linux system. So, you can execute the following command on your terminal:
zip -e archivename.zip directory_name
The command will be prompted to enter and verify the archive password:
Enter password:
Verify password:
How to Unzip Files And Directories unzip is not installed by default in most Linux distributions. So, you can easily install it using the following command.
Now open your terminal and execute the following command on it to install the zip package:
sudo apt install unzip
sudo yum install unzip
To unzip one file. So, you can easily unzip it by using the following command:
unzip filename
To unzip one directory. So, you can easily unzip it by using the following command:
unzip directory_name
To zip multiple files. So, you can easily unzip it by using the following command:
unzip archivename.zip filename1 filename2 filename3
To unzip multiple directories. So, you can easily unzip it by using the following command:
Alternate way to unzip multiple files and directories in linux using the command line. You can use regular expressions, as shown below:
unzip '*.zip'
zip -r archivename.zip directory_name1 directory_name2 file1 file1
To unzip files or directories in diffrent directories, so you can use the following command:
unzip filename.zip -d /path/to/directory
To unzip password protected files or directories in linux using the command line so that you can use the following command:
unzip -P PasswOrd filename.zip
unzip filename.zip -d /path/to/directory
- How to Use the groupmod Command in Linux?
- How to Restrict Access to a Folder with htaccess?
- Laravel 8 Refresh DataTable Without Reloading Page
- How to Model Disable Primary Key & Auto Increment Tutorial?
- How to Remove WordPress Version Number?
- How to Count Total Number of Bits in Number?
- Flutter Route and Navigation Example
- Flutter Richtext Widget Example Tutorial