Guide on How to Unzip Files in Linux?

it’s consistently dangerous when we work with sudo advantages in a Linux machine as you approach all the setup and framework records, and if you mess up with them, your entire framework may crash. So we encourage you to run the underneath referenced or…


This content originally appeared on DEV Community and was authored by cloudytech147

it's consistently dangerous when we work with sudo advantages in a Linux machine as you approach all the setup and framework records, and if you mess up with them, your entire framework may crash. So we encourage you to run the underneath referenced orders with absolute attention to detail.

Additionally, to utilize the unfasten order, it's required to have the unfasten bundle introduced on our Linux machine. You can basically utilize the bundle administrator of any famous Linux circulation you are rushing to introduce the unfasten bundle. Notwithstanding, the vast majority of the Linux appropriations come pre-introduced with this bundle.


$ sudo apt-get -y install unzip

Linux unzip

If you are using Fedora, CentOS, etc. and you have yum package manager, you can use:


$ sudo yum install unzip

How to Unzip Files in Linux?

When we run the unzip command without any options, in the most native form, it simply extracts all the files and directories inside the current directory that you are in.


$ unzip archive.zip

unzip archive

Output Suppression

You can see that the unzip command enlists the details of the files that it is extracting from the archived file. To avoid printing the details and suppress the output, we can simply use the quiet (-q) option along with the unzip command.


$ unzip -q archive.zip

unzip -q archive

How to Extract Files to a Different Directory in Linux?

If you want to extract them to a different directory, you can use the -d option and specify the path to the destination directory. Please note that if you don’t have write access to the destination directory, you can use the sudo command to get the root privileges.


$ unzip archive.zip -d ~/Documents

unzip archive.zip -d ~/Documents

How to Extract a Password-Protected File in Linux?

If you want to unzip a file that is password-protected, you can use the -P option along with the unzip command.


$ unzip -P <password> <zipped-file>

unzip -P <password> <zipped-file>

However, typing the password as plain text in the terminal (command line) could be insecure. What you can do is simply extract the zipped file in a normal manner. When it tries to unzip the files and finds a file with a password, it will automatically prompt you to input the password.


$ unzip archive.zip

unzip archive.zip

Wrapping Up!

To conclude this detailed and comprehensive article, we discussed how to unzip files in Linux using the unzip command.


This content originally appeared on DEV Community and was authored by cloudytech147


Print Share Comment Cite Upload Translate Updates
APA

cloudytech147 | Sciencx (2021-11-18T14:13:43+00:00) Guide on How to Unzip Files in Linux?. Retrieved from https://www.scien.cx/2021/11/18/guide-on-how-to-unzip-files-in-linux/

MLA
" » Guide on How to Unzip Files in Linux?." cloudytech147 | Sciencx - Thursday November 18, 2021, https://www.scien.cx/2021/11/18/guide-on-how-to-unzip-files-in-linux/
HARVARD
cloudytech147 | Sciencx Thursday November 18, 2021 » Guide on How to Unzip Files in Linux?., viewed ,<https://www.scien.cx/2021/11/18/guide-on-how-to-unzip-files-in-linux/>
VANCOUVER
cloudytech147 | Sciencx - » Guide on How to Unzip Files in Linux?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/18/guide-on-how-to-unzip-files-in-linux/
CHICAGO
" » Guide on How to Unzip Files in Linux?." cloudytech147 | Sciencx - Accessed . https://www.scien.cx/2021/11/18/guide-on-how-to-unzip-files-in-linux/
IEEE
" » Guide on How to Unzip Files in Linux?." cloudytech147 | Sciencx [Online]. Available: https://www.scien.cx/2021/11/18/guide-on-how-to-unzip-files-in-linux/. [Accessed: ]
rf:citation
» Guide on How to Unzip Files in Linux? | cloudytech147 | Sciencx | https://www.scien.cx/2021/11/18/guide-on-how-to-unzip-files-in-linux/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.