I have a folder structure as such:
a/
b/
test.js
c/
another_test.js
When I want to find all these files, I tried the globstar approach:
ls a/{,**/}*.js
However, this command errors (but still outputs files) because there is no a/*.jsx
file:
$ ls a/{,**/}*.jsx
ls: a/*.jsx: No such file or directory
a/b/test.js
I want to use this specific glob because in the future, at some point, a/test.js
could exist.
Is there a glob pattern that will find all .js
files in a/
recursively and not error?
I looked at some of the options in this question but couldn't find anything that doesn't error and lists all files.