Skip to content

Instantly share code, notes, and snippets.

@sivadasetty
Last active October 16, 2023 14:04
Show Gist options
  • Save sivadasetty/97caf66ed527340bc0dc28d19d9cad63 to your computer and use it in GitHub Desktop.
Save sivadasetty/97caf66ed527340bc0dc28d19d9cad63 to your computer and use it in GitHub Desktop.
Find number of files in a directory

find . -type f | wc -l (for total number of files in the current directory .)

find . -type d -exec sh -c 'echo "$(find "{}" -maxdepth 1 -type f | wc -l) {}"' \; | awk '$1 > 1000 {print}' (number of files greater than 1000 in the current directory .)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment