How can I count all files without using find and only grep? I tried using ls recursively but how can I pipe that to grep and count files?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
||||
|
To list all files that match a grep pattern:
To count them:
To count all non-empty files in a directory recursively, you search for an empty string (two single quotes):
|
||||
|
|
|
If you really want to use solely
|
|||||||||||
|
|
|||||||
|
find? Parsing thelsoutput is bad. – grawity Jan 17 '12 at 12:40