How to Count file numbers of a folder exclude vendor and node_modules

find . -name “*.*” -not -path “*/node_modules/*” -not -path “*/vendor/*” | wc -l > file_numbers.txt &

example:

$ find . -name “*.php” | wc -l
14407
$ find . | wc -l
401935
$ find . -name “*.js” | wc -l
221760
$ find . -name “*.js” -not -path “*/node_modules/*” | wc -l
920
$ find . -name “*.*” -not -path “*/node_modules/*” | wc -l
25358
$ find . -name “*.*” -not -path “*/node_modules/*” -not -path “*/vendor/*” | wc -l
6012

 

Leave a Reply

Your email address will not be published. Required fields are marked *