filesystem

Get number of all files

When number of file is small, less than 10, 000

$ ls -ls *.<ext> | wc -l

When more than 10, 000 files

$ find -type f -name '*.<ext>'  | wc -l

Storage usage

Check disk partition usage

$ df -h

Check the size of a directory

$ du -hs <directory>

Check size of all subdirectories

$ du -hs *

Searches directory recursively in subdirectories

$ find . -type d -name <directory>

Searches file recursively in subdirectories

$ find . -type f -name <file>

Delete file/directory recursively in subdirectories

$ find . -name <file/directory> -exec rm -rf {} \;