mstone42 0 Newbie Poster

Hi All,

Is there an easier way to get the disk space used, file count, and folder count of a parent folder using BASH commands that is faster than using the 'find' and 'du' commands? In short, I want the same information that the Windows Properties window shows when you right-click a folder (the "Size" and "Contains" values), but via script.

I have some really large folders (e.g. one has 348 subfolders, over 59K files, size is 12G) and running the following script (on the aforementioned folder) takes 15 minutes total, whereas the Properties window displays the totals in about 3 seconds. :/

find ./ -mindepth 1 -type d | wc -l
find ./ -type f | wc -l
du -s

Thanks!
Mitch

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.