Count file in a directory:
ls -l |grep "^-"|wc -l |
Count file in a directory, include subdirectories:
ls -lR|grep "^-"|wc -l |
Count subdirectory in a directory:
ls -l|grep "^d"|wc -l |
Count subdirectory in a directory, include subdirectories:
ls -lR|grep "^d"|wc -l |