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

Creating a Shortcut to Windows Terminal (Or Any Other App That Doesn’t Show Shortcut Option)

Weirdly, Windows Terminal does not allow you to create a shortcut - there's no obvious…

2 months ago

Simplest Wireguard Setup Ever

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

3 months 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…

6 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…

8 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…

9 months ago

Ultimate Ad-Free Browsing

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

1 year ago