Search code examples
regexbashunixfindls

Get detailed data with filtered find result


I need to get a detailed list of all the files ending with "dcc" so I used this:

find . -regex '.*\.dcc$'

And it worked. But as I wrote I need a detailed list just like with ls -l so I used this:

find . -ls -regex '.*\.dcc$'

But that's showing me all the files in the directory.

I managed to overcome this problem with

ls -l `find . -regex '.*\.dcc$'`

But I'm interested to know what was wrong with this:

find . -ls -regex '.*\.dcc$'

Solution

  • Ordering is important:

    find . -regex '.*\.dcc$' -ls