Simple Zipping and Unzipping on Linux

Nothing important here, move to Zipping part.

It's so weird that nobody on internet talks about how to zip and unzip on linux.

I happened to find some articles about this topic but I only got the ones that talk about tar or gz file types.

ChatGPT has destroyed people's mind and I was frustrated just like you. So, here is a quick tutorial of zipping and unzipping.

Zipping:

So let's say you have a zipped file with name: 

alice.zip

How do you unzip this file? Here's the command:

zip -r alice.zip alice

Let me explain what's happening in the above command:

  • zip : tool name
  • -r : flag to make it recursively
  • alice.zip : Final result zip file that you need
  • alice : folder to zip

Unzipping:

Now about Unzipping:

unzip alice.zip -d bob

About this command:

  • unzip : tool name
  • alice.zip : Zipped file that you want to unzip
  • -d : flag to to specify the directory of extraction
  • bob : folder to put the contents of the zipped file

The main thing here is that the directory doesn't have to exist before you run unzip command.

 

I hope it helped you.

Stay tuned on my 𝕏 account for updates. Thank you!

This article was updated on March 2, 2024

I'm Mehul Panchal (𝕏: @0daySecured), an Ethical Hacker and seasoned penetration tester with over 6.5 years of hands-on experience in identifying vulnerabilities and fortifying security for a diverse range of corporate clients. Holding both the OSCP and OSWE certifications, I bring a deep understanding of offensive security techniques and a commitment to staying ahead of the curve in the ever-evolving landscape of cybersecurity.

Currently based in the beautiful city, Prague. I provide my services for Forbes Top 500 ranked clients at a leading cybersecurity firm. My journey in this field began with self-learning computer science and OSCP certification, a foundation that has been significantly strengthened by continuous learning and practical application. My technical expertise is complemented by robust skills in consulting and technical writing, allowing me to effectively communicate the value of security solutions to stakeholders at all levels.