Calculating how many sub directories and files in 'documents/'

I'm learning Linux through a gameshell.

Like the title says; I need to find the amount of sub directories and files in 'documents/'. The command runs fine but its the not the right answer. Here's my command :

find docuemnts/ -type f | wc -l | awk '{print $1}' 

What am i doing wrong ?

Have you considered using:

-type d

in addition to:

-type f

??

Edit: Updated typo.

There is nothing wrong but a typo.
-type f shows files.
-type d shows directories.
\( -type f -o -type d \) shows both.
Assuming there are only files and directories, you can simply show everything

find documents/
3 Likes