APACHE: COUNT NUMBER OF FILES IN DIR & SUBDIRs For example, if you want to recursively count files in the “/etc” directory, you would write the following query : find /etc -type f | wc -l