Skip to content

Instantly share code, notes, and snippets.

@joshcanhelp
Created March 9, 2020 21:09
Show Gist options
  • Save joshcanhelp/839ba258cc6ba46533cbec5886590ddc to your computer and use it in GitHub Desktop.
Save joshcanhelp/839ba258cc6ba46533cbec5886590ddc to your computer and use it in GitHub Desktop.
Deletes unused files
while IFS= read -r -d '' file
do
if grep -qr "$file" ../content/md
then echo "Keeping $file";
else rm "$file";
fi
done < <(find _images -type f -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment