Skip to content

Instantly share code, notes, and snippets.

@thatnerdjosh
Created November 7, 2019 07:21
Show Gist options
  • Save thatnerdjosh/7c6e36b7c261bfb03962951cc335019f to your computer and use it in GitHub Desktop.
Save thatnerdjosh/7c6e36b7c261bfb03962951cc335019f to your computer and use it in GitHub Desktop.
Find images in a given directory and tar!
find <RELATIVE_PATH> -name '*' -exec file {} \; | grep -o -P '^.+: \w+ image' | sed 's/\:.*//' | sed 's| |\\ |g' > image_list
cat image_list | xargs tar -czf images.tar.gz --files-from -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment