DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

Linux: Count number of files inside a directory including its subdirectories

April 12, 2018 DbAppWeb Admin

If you need to count the number of files in a directory as well as all the files in its subdirectories then use the below command.

Count Number of Files in Current Directory

Use the find . -type f | wc -l command to count the number of files in the current directory.

[root@dbappweb ~]# find . -type f | wc -l
4654069

You can also count the number of subdirectories under a directory by using the find . -type d | wc -l command.

[root@dbappweb upload]# find . -type d | wc -l
1853079

Count Number of Files in Any Directory

Use the below command to count the number of files in any directory. /upload is the path of the directory.

[root@dbappweb upload]# find /upload -type f | wc -l
4654075

You can also count the number of subdirectories under a directory by using the find /upload -type d | wc -l command.

[root@dbappweb upload]# find /upload -type d | wc -l
1853079

Last Updated: Apr 11, 2018

Prev Article
Next Article
Tags:File System Linux Sys Admin

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com