Skip to content

Instantly share code, notes, and snippets.

@yyolk
Last active December 25, 2015 00:49
Show Gist options
  • Save yyolk/6890057 to your computer and use it in GitHub Desktop.
Save yyolk/6890057 to your computer and use it in GitHub Desktop.
grab all JPEGs, PNGs, and GIFs from Chrome's cache (useful for when someone deletes a post)
#!/bin/sh
CHROME_CACHE=$HOME/Library/Caches/Google/Chrome/Default/Cache
TMP_DIR=$HOME/Downloads/tmp
mkdir -p $TMP_DIR
for i in $(file $CHROME_CACHE/* | egrep -i 'jp|gif|png' |awk '{print $1}' | sed 's/://g'); do cp -v $i $TMP_DIR/`basename $i`.$(file $i | awk '{print tolower($2)}') ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment