The easiest way to count number of files and subdirectories in a directory using a tree command, which is best known for displaying files and directories in tree-like form.
Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends, & analysis