How to print result of a command as well as the count of results?

Viewed 414

I have to print all files containing a query given as a console argument, the following line does so

find . "$path" -type f -name "*$key*" -print

however I would also like to get the total file count, but doing this:

find . "$path" -type f -name "*$key*" -print | wc -l

will give me the count but not the names of those files, which isn't a desired result. How to fix it with a one liner (if possible)?

1 Answers
Related