Skip to content

Instantly share code, notes, and snippets.

@ukiahsmith
Created December 29, 2018 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukiahsmith/ffae067d1cef5a0d40a232a69a1c8900 to your computer and use it in GitHub Desktop.
Save ukiahsmith/ffae067d1cef5a0d40a232a69a1c8900 to your computer and use it in GitHub Desktop.

I had a python script write some data to some images, but I didn't know which ones. This one liner was able to find which images were corrupted and open them in NeoVim for editing in binary mode.

find . -iname '*jpg' | tr '\n' '\0' | xargs -0 identify 2>&1 | grep -i error | sed "s/^.*\`\(.*\)\'.*/\1/" | tr '\n' '\0' | xargs -0 nvim -b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment