---
title: "Discussion on \"Write a bash script to count the number of directories\" | Hashnode"
description: "Discussion on \"Write a bash script to count the number of directories\". This script will count the number of directories and sub-directories in the current directory but not count the current directory itself."
url: "https://hashnode.com/posts/write-a-bash-script-to-count-the-number-of-directories/629efe78a6bfa05457953c86"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Write a bash script to count the number of directories](https://blog.ehoneahobed.com/write-a-bash-script-to-count-the-number-of-directories?utm_source=hashnode&utm_medium=feed)

This script will count the number of directories and sub-directories in the current directory but not count the current directory itself.

Jun 7, 2022 · 4 min read · blog.ehoneahobed.com  
Read the article

-   [#bash-script](https://hashnode.com/tag/bash-script)
-   [#shell-script](https://hashnode.com/tag/shell-script)
-   [#linux-for-beginners](https://hashnode.com/tag/linux-for-beginners)
-   [#linux-basics](https://hashnode.com/tag/linux-basics)
-   [#linux](https://hashnode.com/tag/linux)

## Written by

[Dr. Ehoneah Obed](https://hashnode.com/@ehoneahobed)

@ehoneahobed

  
[View profile](https://hashnode.com/@ehoneahobed)

Software and AI engineer, health informatician, and registered pharmacist. I write about what I build and what I learn.

Heya! 👋 I love helping people, and one of the best ways I do this is by sharing what I learn and build. I started as a pharmacist at a tertiary hospital in Northern Ghana, where I saw how much technology could improve healthcare. That sparked my interest in digital health. I taught myself to code, then joined the ALX Software Engineering program, which became a turning point. I went on to complete a Master of Health Informatics at the University of Toronto. Today I am a software and AI engineer and a health informatician, and I practise remotely as a Digital Health Pharmacist. I combine clinical experience with technical skills to build tools that solve real problems in health and beyond, and I write here about what I build and what I learn.

## Responses 1

Markdown supported · ⌘↵ to post

[Nosimot olayeni](https://hashnode.com/@motolayeni)

[Aug 7, 2023](https://hashnode.com/posts/write-a-bash-script-to-count-the-number-of-directories/629efe78a6bfa05457953c86/comment/64d0d61b6644e2f8eb7f95be)

what a comprehensive explanation. God bless you
