Reputation: 29349
'ls dir1/*/.ext' just lists all the files with just one level of nesting. What is the command to recursively list all the files with any level of nesting in linux?
Upvotes: 0
Views: 626
Reputation: 6371
You could use find
:
find .
That command would list everything under the current folder
Upvotes: 0
Reputation: 74084
The find
command is one way to do this:
find dir1 -name .ext
The -name
operator can take a wildcard to match with, but it's important to quote the wildcard expression so that it won't be expanded by your shell before calling into find
:
find dir1 -name "*.ext"
The find
command has many operators that can do various different tests on the files in the directory, of which -name
is just one example. Consult the find
manual page for more information.
Upvotes: 1