Categories: Linux

Dunzip – Download and Unzip in Linux With One Command

Tired of downloading zip or tar files, decompressing, and then having to delete the compressed file ?

Do it all in one step with this Tip

  1. Copy and paste this function into your .bashrc (or in my case as I used .zsh, .zshrc):
     dunzip() {wget -qO- $1 | bsdtar -xvf-;}
  2. Then type the following in your terminal:
    source ~/.bashrc  

    If you are using zsh, substitute “.zshrc” for .bashrc.

Works for zip and gzipped tar files.

Example

For details on this command see this stack exchange answer to How to redirect output of wget as input to unzip? by ruario.

Regarding functions and how to use them see with arguments see Make a Bash alias that takes a parameter?.

Charlie

Recent Posts

Simplest Wireguard Setup Ever

Wireguard Wireguard is the newest way to setup a VPN for your home servers. What…

2 weeks ago

Fix Your Smart Home – Stop Tasmota Devices From Switching Randomly

While working on fixing my KuLED light switches from magically but unexpectedly switching on, I…

3 months ago

Using WP-CLI to Access MySQL Running in A LAMP Docker Container

WP-CLI is a great command line tool to help you manage Wordpress. I had trouble…

6 months ago

Backing Up an SD Card or Hard Drive to A VHD File (Virtual Hard Disk)

  The Microsoft Virtual Hard Disk - An Ideal Backup Image Format Microsoft's Virtual Hard…

6 months ago

Ultimate Ad-Free Browsing

Browser getting cluttered with Ads ? Want to achieve a nearly total ad-free browsing experience…

12 months ago

How to Monitor Your Home Remotely With Skype

Want to peek in on your dog ? Have an elderly parent or friend that…

12 months ago