Skip to content

Instantly share code, notes, and snippets.

@kargaranamir
Created March 10, 2023 22:09
Show Gist options
  • Save kargaranamir/e65ec4d0a8d2564c547bbdfd979bd209 to your computer and use it in GitHub Desktop.
Save kargaranamir/e65ec4d0a8d2564c547bbdfd979bd209 to your computer and use it in GitHub Desktop.
Recursively find all files that match a certain pattern

Find files with ./XXX/XXX.md pattern:

find . -regex '.*/*/[^/]*.md'

Find number of files with ./XXX/XXX.md pattern:

find . -regex '.*/*/[^/]*.md' -printf '%i\n' | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment