View the number of files in the current directory
View the number of folders
ls -l | grep ^d | wc -l
View number of files
Does not contain folders
ls -l | grep ^- | wc -l
View the number of all files (including sub-files)
ls -lR | grep ^- | wc -l
View the number of all directories (including subdirectories)
ls -lR | grep ^d | wc -l
View the number of pictures
Count the number of all jpg files in the folder directory:
ls -lR | grep ".*jpg" | wc -l