Skip to content

Instantly share code, notes, and snippets.

@samos123
Created March 1, 2014 03:32
Show Gist options
  • Save samos123/9284685 to your computer and use it in GitHub Desktop.
Save samos123/9284685 to your computer and use it in GitHub Desktop.
Had some problem with cado-nfs which had a bunch of gzipped files which were corruped so tried to decompress them, if the decompression failed it will automatically move the file to upper directory.
ls *.gz -1 | xargs -I {} sh -c "gzip -d {} || true" 2>&1 | awk '{ print $2}' | sed 's/:$//' | xargs -t -I {} mv {} ../{}_bcorrupted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment