Skip to content

Instantly share code, notes, and snippets.

@xntrik
Created January 10, 2012 05:04
Show Gist options
  • Save xntrik/1587088 to your computer and use it in GitHub Desktop.
Save xntrik/1587088 to your computer and use it in GitHub Desktop.
Sometimes you need to unzip a bunch of files looking for junk
#!/bin/bash
echo "Clearing output_dir/"
rm -rf output_dir/
FILES=*.tar.gz
for f in $FILES
do
echo -ne "Processing $f.."
tar -zxvf $f >/dev/null 2>&1
grep -i 'junk' output_dir/*.txt -c
rm -rf output_dir/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment