How to count the number of files in a directory 8 February 2011·45 words·1 min Debian Tips Table of Contents Non recursive Recursive Recursive and follow symlink Table of Contents Non recursive Recursive Recursive and follow symlink How to count the number of files in a directory # Non recursive # find targetdir -type f -maxdepth 1 | wc -l Recursive # find targetdir -type f | wc -l Recursive and follow symlink # find targetdir -type f -follow | wc -l