Linux: How to count files in all the subdirectories in a path

I want to get the number of files in a all the folders in one go in a particular path

Tagged:

Answers

  • You can try this in your shell

    for folder in /path/to/your/folder/*; do
        echo "$(basename "$folder"): $(find "$folder" -type f | wc -l)";
    done
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!