Skip to content

Instantly share code, notes, and snippets.

@ncimino
Created October 10, 2012 18:46
Show Gist options
  • Select an option

  • Save ncimino/3867610 to your computer and use it in GitHub Desktop.

Select an option

Save ncimino/3867610 to your computer and use it in GitHub Desktop.
Untar all
MYDIR="/home/${USER}/archives"
ls ${MYDIR}/*.tar > filelist
for FILENAME in `cat filelist`
do
ARCHDIR=${MYDIR}/$(basename $FILENAME .tar)
mkdir $ARCHDIR
echo ==== Extracting $FILENAME to $ARCHDIR:
tar -xf $FILENAME -C $MYDIR
done
rm filelist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment