Created
November 7, 2019 07:21
-
-
Save thatnerdjosh/7c6e36b7c261bfb03962951cc335019f to your computer and use it in GitHub Desktop.
Find images in a given directory and tar!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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