Last active
October 19, 2022 17:34
-
-
Save luispabon/243e33f1d92aab2301c6b8fd15b72487 to your computer and use it in GitHub Desktop.
Find folders that contain one file but not another
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
find my/search/path -type d -exec test -e '{}'/i_want_this_file.txt -a '!' -e '{}'/but_not_this_one.txt \; -print | sort | |
# Note if not obvs: remove the '!' to search for folders that contain both files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment