How does the linux command match the multi-tier folder path?

requirements: want to match all JS files under folder A (including infinite recursive subdirectories), but not js files under a directory called node_modules descendants.
the current practice is to iterate through the nodeJS folder layer by layer to determine the directory folder name.

feels like it should be done with a linux command, but it"s not written.

could you tell me how to write all the great gods?

Nov.22,2021

find -name '*.js' -not -path '*/node_modules/*'

match multiple files:

find \( -name '*.js' -o -name '*.vue' -o -name '*.jsx' \) -not -path '*/node_modules/*'

of course, you can also match so many suffixes with regular expressions:

find -regextype posix-extended -regex '.*\.(js|vue|jsx)$' -not -path '*/node_modules/*'

find defaults to BRE regularity. Because this expression uses | selection structure, which is not supported by BRE , you must use ERE compatible rules. So you must specify regextype as the posix extension regular to support this regular query


find /A | perl -nle 'print if /^(((?!\/node_modules\/).)*\/((?!\/).)*?\.js)$/'
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40c9b-2c53a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40c9b-2c53a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?