[an error occurred while processing this directive].com

Useful script for downloading on linux

I always go through the same three steps to download a file (in tar.gz format)

  1. wget the tar.gz file I want
  2. untar it
  3. remove the original file I downloaded

So I made a bash script that does those three steps in one. Use it the same way as wget (# simple.sh http://path/to/file.tar.gz)


#!/bin/bash 

# change this to whatever extension you'd like to handle
ext=".tar.gz"

# flags to pass to tar
flg="-zxvf"

wget $1

file=`ls -t *$ext | grep -i -m 1 "^.*$ext$"`

if [[ -n $file ]]
then
    tar $flg $file
    unlink $file
else
    echo "Could not find the downloaded file."
fi


You can download it via this link (Remember to make it executable and to change its extension)

One Comment, Comment or Ping

  1. lewis

    pipe is your friend!

    wget -O – | tar zxf -

Reply to “Useful script for downloading on linux”

  • Viagra ordre
  • Cialis en ligne
  • Levitra en ligne
  • Propecia acheter
  • Viagra acheter
  • Acheter cialis
  • Ordre levitra
  • Ordre propecia
  • En ligne viagra
  • Vente cialis
  • Levitra bon marche
  • Propecia en ligne
  • Viagra online
  • Buy cialis
  • Order Levitra
  • Buy propecia
  • Buy viagra
  • Cheap cialis
  • Cheap Levitra
  • propecia online
  • Viagra prescription
  • Cialis online
  • Buy Levitra
  • Order propecia