- Linux zip files install#
- Linux zip files archive#
- Linux zip files verification#
- Linux zip files code#
Here we had a tar file named “GroceryList.tar” so we extracted it by using the following command. The tar file will be having a varying methodology, we will be using a different method as we did while compressing so it is quite similar to that but here, for a tar file extraction, we will be using tar xvf, Here we write unzip and the name of zipped file we want to unzip. So as in the above list you can the first example we compressed is listed there as compressed file “ TestDirTerminal.zip”, we will now compress this file by using the unzip command. You may see the following commands on the screen while you run it on our own end.Īt first, we will extract our files for zip files.
Linux zip files install#
We use the command sudo apt-get install unzip for this purpose.
Linux zip files code#
But at first, we need to install the unzip code as we did earlier for zipping. To unzip the file, we will be using the command, unzip.
Linux zip files verification#
We can always use the ls command for the verification Here, as you can see the GroceryList.tar has been created. V: to display the output in the terminal (used for verification) Here we have GroceryList so, for this we will be using tar cvf įor too many files we will use tar command. The outcome shows that a GroceryList.gz has been created at the Desktop directory. We can also use gzip command to compress a file as we did with the GroceryList. Once created, both the TestFile and Testfolder.zip can be seen at the Desktop. Similarly, we want to zip the file we will use the following command as follows. We can find anything of our interest enlisted where TestFolder and TestFile are also listed.įor the sake of zipping the folder, we will use the following command. After doing that we see the elements of the directory using “dir” command.
![linux zip files linux zip files](https://thehacktoday.com/wp-content/uploads/2021/11/zip-1.png)
We will move our current directory to Desktop if it is not selected earlier. We will compress a file and a folder respectively in this step. We have chosen a folder, TestFolder for this purpose and a file TestFile as you can see. We can also compress the files using the command line in Linux. The folder we wanted to compress has been compressed. We use the command “ zip –r folderName folder” to which we want to compress our folder.Įventually, the compressed TestDirTerminal.zip is created, which we wanted to create by compressing our folder TestDir, so as we can see it has been created. The file we want to compress is also in the list. We can see the currently present folders on our Desktop by using ls command. So, therefore in command line in Linux, we will also change our current directory to the desktop. We want to compress the folder named TestDir here whose current directory is Desktop. The next step is to compress the required files using the zip command. The installation begins and the command line looks like this. So, now we will open the terminal to install the zip command.Īfter opening the terminal, write the command, “ sudo apt install zip unzip” to install the zip command. Zip or compress the folderįor the purpose of compression, we need to install the zip command at first, for which we will use “ apt command ” or “ apt-get command ”.
![linux zip files linux zip files](https://www.cyberciti.biz/media/new/faq/2018/01/data.zip-created-using-GUI-method-599W.gif)
This tutorial will help you learn to compress and manage a folder on Ubuntu Linux using the command line. We also have a program called unzip that is used to unpack the zip archives. It is a utility for compression and file packaging.
Linux zip files archive#
For compression of archive files, we happen to use the zip command. Every time, you need to download a larger number of files or numerous tasks, or even when you need a backup for a website, you need to learn few basic commands for zipping and unzipping the folders in Linux.
![linux zip files linux zip files](https://www.journaldev.com/wp-content/uploads/2019/04/delete-files-after-zipping.png)
zip archive on a Linux machine, it is not that much easy as it is in windows.