Skip to content

Instantly share code, notes, and snippets.

@luispabon
Last active October 19, 2022 17:34
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 luispabon/243e33f1d92aab2301c6b8fd15b72487 to your computer and use it in GitHub Desktop.
Save luispabon/243e33f1d92aab2301c6b8fd15b72487 to your computer and use it in GitHub Desktop.
Find folders that contain one file but not another
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