Created
April 12, 2018 02:40
-
-
Save tralston/dbac147078edf6725f405ef7fd3e0b5b to your computer and use it in GitHub Desktop.
[Find files based on return value of function]
This file contains hidden or 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
# Will find files based on if the magic file type 'file $file.ext' matches pattern, then print the filename | |
# e.g. look for sqlite dbs | |
find . -type f -exec sh -c 'case "$(file -b "$0")" in *"SQLite"*) true;; *) false;; esac' {} \; -print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment